Rename RFCOMM_GetFrameDataLength() to RFCOMM_GetVariableFieldValue() as it is multi-purpose, and modify it to move the buffer pointer itself rather than relying on the caller.

Make RFCOMM_GetChannelData() return NULL if the required channel DLCI is found, but the channel is closed.

Add modem signals (BREAK, DCD, etc.) to the channel state array, and add in a handler for the Modem Status RFCOMM control command.
This commit is contained in:
Dean Camera 2010-06-15 11:28:15 +00:00
parent f5d079462d
commit 13ea700b35
4 changed files with 100 additions and 35 deletions

View file

@ -86,7 +86,10 @@
uint8_t State;
uint8_t Priority;
bool UseUIFrames;
uint16_t RemoteMTU;
uint16_t MTU;
uint8_t StatusFlags;
uint8_t Signals;
uint8_t BreakSignals;
} RFCOMM_Channel_t;
/* External Variables: */
@ -97,7 +100,7 @@
void RFCOMM_ProcessPacket(void* Data, Bluetooth_Channel_t* const Channel);
RFCOMM_Channel_t* RFCOMM_GetChannelData(const uint8_t DLCI);
uint16_t RFCOMM_GetFrameDataLength(const uint8_t* const BufferPos);
uint16_t RFCOMM_GetVariableFieldValue(const uint8_t** BufferPos);
void RFCOMM_SendFrame(const uint8_t DLCI, const bool CommandResponse, const uint8_t Control,
const uint16_t DataLen, const void* Data, Bluetooth_Channel_t* const Channel);