示例#1
0
/* Retrieve the rfcomm server channel */
static uint16 getRfcommChannelNumber(const uint8 *begin, const uint8 *end, uint16 *chan)
{
    Region value;
    if(findRfcommServerChannel(begin, end, &value))
    {
        *chan = (uint16) RegionReadUnsigned(&value);
        return 1;
    }
    return 0;
}
示例#2
0
/* Insert the rfcomm server channel into a service record */
static uint16 insertRfcommServerChannel(const uint8 *ptr, const uint8 *end, uint8 chan)
{
    Region value;
    if(findRfcommServerChannel(ptr, end, &value) && RegionSize(&value) == 1)
    {
		RegionWriteUnsigned(&value, (uint32) chan);
		return 1;
    }
    return 0;
}