LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
c_bt.h File Reference
#include "lms2012.h"
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <bluetooth/hci.h>

Go to the source code of this file.

Data Structures

struct  READBUF
 
struct  WRITEBUF
 
struct  MSGBUF
 
struct  HCISOCKET
 
struct  LISTENSOCKET
 
struct  BTSOCKET
 
struct  DEVICELIST
 
struct  SEARCHLIST
 
struct  BTCH
 
struct  NONVOLBT
 
struct  INCOMMING
 
struct  OUTGOING
 
struct  TRUSTED_DEV
 
struct  BT_GLOBALS
 

Macros

#define NONVOL_BT_DATA   "settings/nonvolbt"
 
#define MAX_DEV_TABLE_ENTRIES   30
 
#define BT_CH_OFFSET   2
 
#define MAX_NAME_SIZE   32
 
#define MAX_BT_NAME_SIZE   248
 
#define MAX_BUNDLE_ID_SIZE   24
 
#define MAX_BUNDLE_SEED_ID_SIZE   11
 

Enumerations

enum  {
  BT_SLAVE_CH0, BT_HOST_CH0, BT_HOST_CH1, BT_HOST_CH2,
  BT_HOST_CH3, BT_HOST_CH4, BT_HOST_CH5, BT_HOST_CH6,
  NO_OF_BT_CHS
}
 
enum  { DEV_EMPTY = 0x00, DEV_KNOWN = 0x01 }
 
enum  { READ_BUF_EMPTY, READ_BUF_FULL }
 
enum  { SCAN_OFF, SCAN_INQ_STATE, SCAN_NAME_STATE }
 
enum  { CH_CONNECTING, CH_FREE, CH_CONNECTED }
 
enum  {
  HCI_IDLE = 0x00, HCI_ONOFF = 0x01, HCI_VISIBLE = 0x02, HCI_NAME = 0x04,
  HCI_SCAN = 0x08, HCI_CONNECT = 0x10, HCI_DISCONNECT = 0x20, HCI_RESTART = 0x40,
  HCI_FAIL = 0x80
}
 

Functions

void IncommingConnect (void)
 
void BtInit (char *pName)
 
void BtExit (void)
 
void BtUpdate (void)
 
void BtTxMsgs (void)
 
UBYTE cBtConnect (UBYTE *pName)
 
UBYTE cBtDisconnect (UBYTE *pName)
 
UBYTE cBtDiscChNo (UBYTE ChNo)
 
UWORD cBtReadCh0 (UBYTE *pBuf, UWORD Length)
 
UWORD cBtReadCh1 (UBYTE *pBuf, UWORD Length)
 
UWORD cBtReadCh2 (UBYTE *pBuf, UWORD Length)
 
UWORD cBtReadCh3 (UBYTE *pBuf, UWORD Length)
 
UWORD cBtReadCh4 (UBYTE *pBuf, UWORD Length)
 
UWORD cBtReadCh5 (UBYTE *pBuf, UWORD Length)
 
UWORD cBtReadCh6 (UBYTE *pBuf, UWORD Length)
 
UWORD cBtReadCh7 (UBYTE *pBuf, UWORD Length)
 
UWORD cBtDevWriteBuf (UBYTE *pBuf, UWORD Size)
 
UWORD cBtDevWriteBuf1 (UBYTE *pBuf, UWORD Size)
 
UWORD cBtDevWriteBuf2 (UBYTE *pBuf, UWORD Size)
 
UWORD cBtDevWriteBuf3 (UBYTE *pBuf, UWORD Size)
 
UWORD cBtDevWriteBuf4 (UBYTE *pBuf, UWORD Size)
 
UWORD cBtDevWriteBuf5 (UBYTE *pBuf, UWORD Size)
 
UWORD cBtDevWriteBuf6 (UBYTE *pBuf, UWORD Size)
 
UWORD cBtDevWriteBuf7 (UBYTE *pBuf, UWORD Size)
 
UBYTE cBtI2cBufReady (void)
 
UWORD cBtI2cToBtBuf (UBYTE *pBuf, UWORD Size)
 
UBYTE BtSetVisibility (UBYTE State)
 
UBYTE BtGetVisibility (void)
 
UBYTE BtSetOnOff (UBYTE On)
 
UBYTE BtGetOnOff (UBYTE *On)
 
UBYTE BtSetMode2 (UBYTE Mode2)
 
UBYTE BtGetMode2 (UBYTE *pMode2)
 
UBYTE BtStartScan (void)
 
UBYTE BtStopScan (void)
 
UBYTE cBtGetNoOfConnListEntries (void)
 
UBYTE cBtGetConnListEntry (UBYTE Item, UBYTE *pName, SBYTE Length, UBYTE *pType)
 
UBYTE cBtGetNoOfDevListEntries (void)
 
UBYTE cBtGetDevListEntry (UBYTE Item, SBYTE *pConnected, SBYTE *pType, UBYTE *pName, SBYTE Length)
 
UBYTE cBtDeleteFavourItem (UBYTE *pName)
 
UBYTE cBtGetNoOfSearchListEntries (void)
 
UBYTE cBtGetSearchListEntry (UBYTE Item, SBYTE *pConnected, SBYTE *pType, SBYTE *pParred, UBYTE *pName, SBYTE Length)
 
UBYTE cBtGetHciBusyFlag (void)
 
void DecodeMode1 (UBYTE BufNo)
 
UBYTE cBtGetStatus (void)
 
void cBtGetId (UBYTE *pId, UBYTE Length)
 
UBYTE cBtSetName (UBYTE *pName, UBYTE Length)
 
UBYTE cBtGetChNo (UBYTE *pName, UBYTE *pChNo)
 
void cBtGetIncoming (UBYTE *pName, UBYTE *pCod, UBYTE Len)
 
UBYTE cBtGetEvent (void)
 
UBYTE cBtSetPin (UBYTE *pPin)
 
UBYTE cBtSetPasskey (UBYTE Accept)
 
void cBtSetTrustedDev (UBYTE *pBtAddr, UBYTE *pPin, UBYTE PinSize)
 
UWORD cBtSetBundleId (UBYTE *pId)
 
UWORD cBtSetBundleSeedId (UBYTE *pSeedId)
 

Macro Definition Documentation

#define BT_CH_OFFSET   2

Definition at line 37 of file c_bt.h.

#define MAX_BT_NAME_SIZE   248

Definition at line 39 of file c_bt.h.

#define MAX_BUNDLE_ID_SIZE   24

Definition at line 41 of file c_bt.h.

#define MAX_BUNDLE_SEED_ID_SIZE   11

Definition at line 42 of file c_bt.h.

#define MAX_DEV_TABLE_ENTRIES   30

Definition at line 36 of file c_bt.h.

#define MAX_NAME_SIZE   32

Definition at line 38 of file c_bt.h.

#define NONVOL_BT_DATA   "settings/nonvolbt"

Definition at line 33 of file c_bt.h.

Enumeration Type Documentation

anonymous enum
Enumerator
BT_SLAVE_CH0 
BT_HOST_CH0 
BT_HOST_CH1 
BT_HOST_CH2 
BT_HOST_CH3 
BT_HOST_CH4 
BT_HOST_CH5 
BT_HOST_CH6 
NO_OF_BT_CHS 

Definition at line 45 of file c_bt.h.

anonymous enum
Enumerator
DEV_EMPTY 
DEV_KNOWN 

Definition at line 60 of file c_bt.h.

anonymous enum
Enumerator
READ_BUF_EMPTY 
READ_BUF_FULL 

Definition at line 66 of file c_bt.h.

anonymous enum
Enumerator
SCAN_OFF 
SCAN_INQ_STATE 
SCAN_NAME_STATE 

Definition at line 72 of file c_bt.h.

anonymous enum
Enumerator
CH_CONNECTING 
CH_FREE 
CH_CONNECTED 

Definition at line 80 of file c_bt.h.

anonymous enum
Enumerator
HCI_IDLE 
HCI_ONOFF 
HCI_VISIBLE 
HCI_NAME 
HCI_SCAN 
HCI_CONNECT 
HCI_DISCONNECT 
HCI_RESTART 
HCI_FAIL 

Definition at line 88 of file c_bt.h.

Function Documentation

void BtExit ( void  )

Definition at line 426 of file c_bt.c.

UBYTE BtGetMode2 ( UBYTE pMode2)

Definition at line 1990 of file c_bt.c.

UBYTE BtGetOnOff ( UBYTE On)

Definition at line 2042 of file c_bt.c.

UBYTE BtGetVisibility ( void  )

Definition at line 2114 of file c_bt.c.

void BtInit ( char *  pName)

Definition at line 349 of file c_bt.c.

UBYTE BtSetMode2 ( UBYTE  Mode2)

Definition at line 1936 of file c_bt.c.

UBYTE BtSetOnOff ( UBYTE  On)

Definition at line 2000 of file c_bt.c.

UBYTE BtSetVisibility ( UBYTE  State)

Definition at line 2076 of file c_bt.c.

UBYTE BtStartScan ( void  )

Definition at line 646 of file c_bt.c.

UBYTE BtStopScan ( void  )

Definition at line 664 of file c_bt.c.

void BtTxMsgs ( void  )

Definition at line 2461 of file c_bt.c.

void BtUpdate ( void  )

Definition at line 1572 of file c_bt.c.

UBYTE cBtConnect ( UBYTE pName)

Definition at line 2276 of file c_bt.c.

UBYTE cBtDeleteFavourItem ( UBYTE pName)

Definition at line 3556 of file c_bt.c.

UWORD cBtDevWriteBuf ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2547 of file c_bt.c.

UWORD cBtDevWriteBuf1 ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2577 of file c_bt.c.

UWORD cBtDevWriteBuf2 ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2592 of file c_bt.c.

UWORD cBtDevWriteBuf3 ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2607 of file c_bt.c.

UWORD cBtDevWriteBuf4 ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2622 of file c_bt.c.

UWORD cBtDevWriteBuf5 ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2637 of file c_bt.c.

UWORD cBtDevWriteBuf6 ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2652 of file c_bt.c.

UWORD cBtDevWriteBuf7 ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2667 of file c_bt.c.

UBYTE cBtDiscChNo ( UBYTE  ChNo)

Definition at line 2396 of file c_bt.c.

UBYTE cBtDisconnect ( UBYTE pName)

Definition at line 2415 of file c_bt.c.

UBYTE cBtGetChNo ( UBYTE pName,
UBYTE pChNo 
)

Definition at line 3680 of file c_bt.c.

UBYTE cBtGetConnListEntry ( UBYTE  Item,
UBYTE pName,
SBYTE  Length,
UBYTE pType 
)

Definition at line 3489 of file c_bt.c.

UBYTE cBtGetDevListEntry ( UBYTE  Item,
SBYTE pConnected,
SBYTE pType,
UBYTE pName,
SBYTE  Length 
)

Definition at line 3523 of file c_bt.c.

UBYTE cBtGetEvent ( void  )

Definition at line 4174 of file c_bt.c.

UBYTE cBtGetHciBusyFlag ( void  )

Definition at line 3433 of file c_bt.c.

void cBtGetId ( UBYTE pId,
UBYTE  Length 
)

Definition at line 3645 of file c_bt.c.

void cBtGetIncoming ( UBYTE pName,
UBYTE pCod,
UBYTE  Len 
)

Definition at line 4184 of file c_bt.c.

UBYTE cBtGetNoOfConnListEntries ( void  )

Definition at line 3483 of file c_bt.c.

UBYTE cBtGetNoOfDevListEntries ( void  )

Definition at line 3517 of file c_bt.c.

UBYTE cBtGetNoOfSearchListEntries ( void  )

Definition at line 3536 of file c_bt.c.

UBYTE cBtGetSearchListEntry ( UBYTE  Item,
SBYTE pConnected,
SBYTE pType,
SBYTE pParred,
UBYTE pName,
SBYTE  Length 
)

Definition at line 3542 of file c_bt.c.

UBYTE cBtGetStatus ( void  )

Definition at line 3621 of file c_bt.c.

UBYTE cBtI2cBufReady ( void  )

Definition at line 2523 of file c_bt.c.

UWORD cBtI2cToBtBuf ( UBYTE pBuf,
UWORD  Size 
)

Definition at line 2536 of file c_bt.c.

UWORD cBtReadCh0 ( UBYTE pBuf,
UWORD  Length 
)

Definition at line 706 of file c_bt.c.

UWORD cBtReadCh1 ( UBYTE pBuf,
UWORD  Length 
)

Definition at line 727 of file c_bt.c.

UWORD cBtReadCh2 ( UBYTE pBuf,
UWORD  Length 
)

Definition at line 749 of file c_bt.c.

UWORD cBtReadCh3 ( UBYTE pBuf,
UWORD  Length 
)

Definition at line 771 of file c_bt.c.

UWORD cBtReadCh4 ( UBYTE pBuf,
UWORD  Length 
)

Definition at line 793 of file c_bt.c.

UWORD cBtReadCh5 ( UBYTE pBuf,
UWORD  Length 
)

Definition at line 815 of file c_bt.c.

UWORD cBtReadCh6 ( UBYTE pBuf,
UWORD  Length 
)

Definition at line 837 of file c_bt.c.

UWORD cBtReadCh7 ( UBYTE pBuf,
UWORD  Length 
)

Definition at line 858 of file c_bt.c.

UWORD cBtSetBundleId ( UBYTE pId)

Definition at line 4265 of file c_bt.c.

UWORD cBtSetBundleSeedId ( UBYTE pSeedId)

Definition at line 4279 of file c_bt.c.

UBYTE cBtSetName ( UBYTE pName,
UBYTE  Length 
)

Definition at line 3651 of file c_bt.c.

UBYTE cBtSetPasskey ( UBYTE  Accept)

Definition at line 4212 of file c_bt.c.

UBYTE cBtSetPin ( UBYTE pPin)

Definition at line 4191 of file c_bt.c.

void cBtSetTrustedDev ( UBYTE pBtAddr,
UBYTE pPin,
UBYTE  PinSize 
)

Definition at line 4240 of file c_bt.c.

void DecodeMode1 ( UBYTE  BufNo)

Definition at line 920 of file c_bt.c.

void IncommingConnect ( void  )