*/
+#include "config.h"
+
/* "Turn on" prototypes in fbus.h */
#define __fbus_c
#include "protocol/fbus.h"
#include "protocol/at.h"
#include "newmodules/newat.h"
+#ifndef UCLINUX
#include "newmodules/n6110.h"
+#endif /* UCLINUX */
#include "misc.h"
+static GSM_Error FBUS_Initialise(char *port_device, char *initlength,
+ GSM_ConnectionType connection,
+ void (*rlp_callback)(RLP_F96Frame *frame));
+
+static int FBUS_SendMessage(u16 message_length, u8 message_type, u8 *buffer);
+static int FBUS_SendFrame(u16 message_length, u8 message_type, u8 *buffer);
+static void FBUS_Terminate(void);
+static void FBUS_RX_StateMachine(unsigned char rx_byte);
+
GSM_Protocol FBUS_Functions = {
FBUS_Initialise,
FBUS_SendMessage,
};
/* Local variables */
-enum FBUS_RX_States RX_State;
+static enum FBUS_RX_States RX_State;
-u8 MessageDestination, MessageSource;
+static u8 MessageDestination, MessageSource;
-u16 BufferCount, MultiBufferCount;
+static u16 BufferCount;
-u16 MessageLength, MultiMessageLength;
+static u16 MessageLength, MultiMessageLength;
-bool RX_Multiple = false;
+static bool RX_Multiple = false;
-u8 MessageType,MultiMessageType;
+static u8 MessageType,MultiMessageType;
-u8 MessageBuffer[FBUS_MAX_RECEIVE_LENGTH * 6],MultiMessageBuffer[FBUS_MAX_RECEIVE_LENGTH * 6];
+static u8 MessageBuffer[FBUS_MAX_RECEIVE_LENGTH * 6],MultiMessageBuffer[FBUS_MAX_RECEIVE_LENGTH * 6];
-u8 RequestSequenceNumber = 0x00;
+static u8 RequestSequenceNumber = 0x00;
#ifdef DEBUG
-char *N61_PrintDevice(int Device)
+static char *N61_PrintDevice(int Device)
{
switch (Device) {
/* N61_RX_DisplayMessage is called when a message we don't know about is
received so that the user can see what is going back and forth, and perhaps
shed some more light/explain another message type! */
-void N61_RX_DisplayMessage()
+static void N61_RX_DisplayMessage()
{
#ifdef DEBUG
fprintf(stdout, _("Msg Dest: %s\n"), N61_PrintDevice(MessageDestination));
return (true);
}
-int FBUS_SendAck(u8 message_type, u8 message_seq) {
+static int FBUS_SendAck(u8 message_type, u8 message_seq) {
unsigned char request[6];
case FBUS_RX_Sync:
if ((CurrentConnectionType==GCT_FBUS && rx_byte == FBUS_FRAME_ID) ||
- ((CurrentConnectionType==GCT_Infrared ||
- CurrentConnectionType==GCT_Tekram) && rx_byte == FBUS_IR_FRAME_ID)) {
+ 0/*((CurrentConnectionType==GCT_Infrared ||
+ CurrentConnectionType==GCT_Tekram) && rx_byte == FBUS_IR_FRAME_ID)*/) {
BufferCount = 0;
}
/* Called by initialisation code to open comm port in asynchronous mode. */
-bool FBUS_OpenSerial(void)
+static bool FBUS_OpenSerial(void)
{
/* Uncomment, if want to test first method for DLR3 */
// unsigned char req[3] = {"AT\r"};
device_setdtrrts(1, 0);
break;
+#ifndef UCLINUX
case GCT_DLR3:
#ifdef DEBUG
/* It's more complicated and not done here */
break;
+#endif /* UCLINUX */
default:
#ifdef DEBUG
fprintf(stdout,_("Wrong connection type for fbus module. Inform marcin-wiacek@topnet.pl about it\n"));
}
/* Initialise variables and state machine. */
-GSM_Error FBUS_Initialise(char *port_device, char *initlength,
+static GSM_Error FBUS_Initialise(char *port_device, char *initlength,
GSM_ConnectionType connection,
void (*rlp_callback)(RLP_F96Frame *frame))
{