Specifications
45
EndIf
Next
SerialClose(ComRS232)
EndIf
EndSub
Sub IridiumTx
If NOT (SummerTxRate OR WinterTxRate OR (GPSType="N")) Then ExitSub
Call TxModuleInit
If NOT TxInitializeOk Then
SerialClose(ComRS232)
ExitSub
EndIf
SerialOpen(ComRS232,19200,0,0,400)
If SerialOut(ComRS232,"AT*S=1"+CHR(13)+CHR(10),"OK"+CHR(13)+CHR(10),1,10) Then
If SerialOut(ComRS232,"AT+SBDD0"+CHR(13)+CHR(10),"0",1,10) Then TxMObuffCleare
If SerialOut(ComRS232,"AT+SBDWT"+CHR(13)+CHR(10),"READY" + CHR(13) + CHR(10),
SerialOutBlock (ComRS232,TxString+CHR(13),Len(TxString)+10)
If SerialOut(ComRS232,"","0"+CHR(13)+CHR(10),1,100) Then TxMOuploaded = True
EndIf
If NOT (TxMObuffCleared AND TxMOuploaded AND TxModuleRFon) Then
SerialClose(ComRS232)
ExitSub
EndIf
Timer(1,sec,2)
Do
'\GPc1 = GPc1+1
TxTimeoutTimer = Timer(1,sec,4)
If TxTimeoutTimer >= TxTimeout Then 'the = is needed because the timer has a
Timer(1,sec,3)
SerialClose(ComRS232)
ExitSub
EndIf
SerialFlush(ComRS232)
If SerialOut(ComRS232,"AT+CIER=1,1,1,0"+CHR(13)+CHR(10),"OK"+CHR(13)+CHR(10)
Do
TxTimeoutTimer = Timer(1,sec,4)
If TxTimeoutTimer >= TxTimeout Then 'the = is needed because the timer has
Timer(1,sec,3)
SerialClose(ComRS232)
ExitSub
EndIf
SerialIn(TxModuleReply,ComRS232, TxTimeout*100, CHR(13)+CHR(10),15)' put h
If InStr(1,TxModuleReply,"+CIEV:0,",4) Then TxRSSI = Mid(TxModuleReply, In
If InStr(1,TxModuleReply,"+CIEV:1,",4) Then TxSvcAvail = Mid(TxModuleReply
Loop Until TxSvcAvail AND TxRSSI > 0
If SerialOut(ComRS232,"AT+CIER=0,1,1,0"+CHR(13)+CHR(10),"OK"+CHR(13)+CHR(10)
SerialFlush(ComRS232)
If NOT TxAllowed Then ExitDo
TxSendAttempts=TxSendAttempts+1
SBDsession = True'\
SerialOut(ComRS232,"AT+SBDI"+CHR(13),"",1,10)
SerialOut(ComRS232,"","+SBDI:",1,6000)' WAIT up to 1 minute for the outcome
SerialIn(TxModuleReply,ComRS232, 0, 13, 40)
SplitStr(SBDIparsed(1),TxModuleReply,CHR(44),6,0)
If SBDIparsed(1)="1" AND SBDIparsed(2) <> LastSuccessfulMOMSN Then
TxSendSuccess = True
SentWithSuccess = SentWithSuccess + 1
LastSuccessfulMOMSN = SBDIparsed(2)