3 #include "../../gsmstate.h" 5 #if defined(GSM_ENABLE_BLUEGNAPBUS) || defined(GSM_ENABLE_IRDAGNAPBUS) 11 #include "../../gsmcomon.h" 15 int MsgLength,
int MsgType)
17 unsigned char *buffer=NULL;
18 int sent=0,length=0,i=0;
19 unsigned char checksum=0;
23 buffer = (
unsigned char *)malloc(MsgLength + 10);
27 buffer[2] = MsgLength / 256;
28 buffer[3] = MsgLength % 256;
31 memcpy(buffer + 6, MsgBuffer, MsgLength);
34 if (MsgLength & 1) buffer[length++] = 0x00;
39 for (i = 0; i < length; i+=2) checksum ^= buffer[i];
40 buffer[length++] = checksum;
43 for (i = 1; i < length; i+=2) checksum ^= buffer[i];
44 buffer[length++] = checksum;
77 }
else smprintf(s,
"Sync error: %02x\n",rx_char);
150 GNAPBUS_WriteMessage,
151 GNAPBUS_StateMachine,
void GSM_DumpMessageBinary(GSM_StateMachine *s, unsigned const char *message, size_t messagesize, int type)
struct GSM_Protocol::@1 Data
int(* WriteDevice)(GSM_StateMachine *s, const void *buf, size_t nbytes)
unsigned char CheckSum[2]
GSM_Device_Functions * Functions
GSM_Phone_Functions * Functions
GSM_Error(* DispatchMessage)(GSM_StateMachine *s)
GSM_Protocol_Message * RequestMsg
void GSM_DumpMessageText(GSM_StateMachine *s, unsigned const char *message, size_t messagesize, int type)
int smprintf(GSM_StateMachine *s, const char *format,...)