Skip to content

Commit 0839ce6

Browse files
authored
Merge pull request #10 from sparkfun/release_candidate
v3.0.4: add weak functions beginSerialPort and endSerialPort for the AGT
2 parents 4652dc9 + 87d9875 commit 0839ce6

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=IridiumSBDi2c
2-
version=3.0.3
2+
version=3.0.4
33
author=Mikal Hart and Paul Clark (PaulZC)
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=This library supports satellite data transmissions from anywhere on earth using the RockBLOCK family of Iridium 9602 and 9603 modems.

src/IridiumSBD.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ int IridiumSBD::begin()
4646

4747
// Absent a successful startup, keep the device turned off
4848
if (ret != ISBD_SUCCESS)
49+
{
50+
if (this->useSerial)
51+
endSerialPort(); // Apollo3 v2.1 Serial fix
4952
power(false);
53+
}
5054

5155
return ret;
5256
}
@@ -125,7 +129,12 @@ int IridiumSBD::sleep()
125129
this->reentrant = false;
126130

127131
if (ret == ISBD_SUCCESS)
132+
{
133+
if (this->useSerial)
134+
endSerialPort(); // Apollo3 v2.1 Serial fix
128135
power(false); // power off
136+
}
137+
129138
return ret;
130139
}
131140

@@ -537,6 +546,9 @@ int IridiumSBD::internalBegin()
537546

538547
power(true); // power on
539548

549+
if (this->useSerial) // If we are using Serial
550+
beginSerialPort(); // Apollo3 v2.1 Serial fix
551+
540552
bool modemAlive = false;
541553

542554
unsigned long startupTime = 500; //ms
@@ -1158,6 +1170,16 @@ void IridiumSBD::setSleepPin(uint8_t enable)
11581170
diagprint(F("LOW\r\n"));
11591171
}
11601172

1173+
void IridiumSBD::beginSerialPort()
1174+
{
1175+
diagprint(F("IridiumSBD::beginSerialPort\r\n"));
1176+
}
1177+
1178+
void IridiumSBD::endSerialPort()
1179+
{
1180+
diagprint(F("IridiumSBD::endSerialPort\r\n"));
1181+
}
1182+
11611183
void IridiumSBD::send(FlashString str, bool beginLine, bool endLine)
11621184
{
11631185
if (beginLine)

src/IridiumSBD.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ class IridiumSBD
138138
void configureSleepPin() __attribute__((weak));
139139
void setSleepPin(uint8_t enable) __attribute__((weak));
140140

141+
// Weak functions to begin and end the Serial port after power(true) and before power(false)
142+
void beginSerialPort() __attribute__((weak));
143+
void endSerialPort() __attribute__((weak));
144+
141145
IridiumSBD(Stream &str, int sleepPinNo = -1, int ringPinNo = -1)
142146
{
143147
useSerial = true;

0 commit comments

Comments
 (0)