X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=include%2Fprotocol%2Fmbus.h;fp=include%2Fprotocol%2Fmbus.h;h=65eaa8217b0d004e5d0ff2ef34e05291a6ff5715;hp=0000000000000000000000000000000000000000;hb=2e0972b02d101bb0d8e9d3e15d2ac80def491a63;hpb=cc37b87508c91b5d4f21fd4bbc298104ae7de1dc diff --git a/include/protocol/mbus.h b/include/protocol/mbus.h new file mode 100644 index 0000000..65eaa82 --- /dev/null +++ b/include/protocol/mbus.h @@ -0,0 +1,44 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See mbus-6110.c for more details. + +*/ + +#ifndef __mbus_h +#define __mbus_h + +#include "gsm-api.h" + +/* This byte is at the beginning of all GSM Frames sent over MBUS to Nokia + 6110 phones. */ +#define MBUS_FRAME_ID 0x1f + +/* Our PC (MBUS). */ +#define MBUS_DEVICE_PC1 0x10 +#define MBUS_DEVICE_PC2 0x1d + +#define MBUS_MAX_TRANSMIT_LENGTH (1000) +#define MBUS_MAX_RECEIVE_LENGTH (1000) +#define MBUS_MAX_CONTENT_LENGTH (1000) + +/* Global variables */ +extern GSM_Protocol MBUS_Functions; + +GSM_Error MBUS_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +int MBUS_SendMessage(u16 message_length, u8 message_type, u8 *buffer); +int MBUS_SendFrame(u16 message_length, u8 message_type, u8 *buffer); +void MBUS_Terminate(void); +bool MBUS_WritePhone (u16 length, u8 *buffer); +void MBUS_RX_StateMachine(unsigned char rx_byte); + +#endif /* __fbus_h */