2564的SPPLEDEMO里的SNIFFMODE命令参数到底怎么配?
我写的是SniffMode 1 500 48 30 1000
命令格式:SniffMode [SerialPortID] [MaxInterval] [MinInterval] [Attempt] [Timeout]
SerialPortID 和Attempt到底是什么?
HCI_Sniff_Mode
This command places the specified connection into Sniff Mode as per the specified parameters.
Prototype:
int BTPSAPI HCI_Sniff_Mode(unsigned int BluetoothStackID, Word_t Connection_Handle, Word_t Sniff_Max_Interval, Word_t Sniff_Min_Interval, Word_t Sniff_Attempt, Word_t Sniff_Timeout, Byte_t *StatusResult)
Parameters:
BluetoothStackID1 Unique identifier assigned to this Bluetooth Protocol Stack via a call to BSC_Initialize
Connection_Handle Unique identifier for the connection returned in the Connection Complete event associated with the HCI_Create_Connection command. Sniff_Max_Interval Maximum time between each sniff period. Values are number of baseband slots (0.625 msec), with a range of 0.625 msec (0x0001)to 40.9 sec (0xFFFF).
Sniff_Min_Interval Minimum time between each sniff period. Values are number of baseband slots (0.625 msec), with a range of 0.625 msec (0x0001) to 40.9 sec (0xFFFF).
bo xu6:
返回 Invalid Command
bo xu6:
回复 bo xu6:
sniffmode的使用真的没有什么好的文档,第一次弄全无头绪。我开启了服务后(Open 9),Server Opened: Server Port 9,Serial Port ID 1,所以我终于找到了这个所谓的Serial port ID ,然后我输入SniffMode 1 500 48 30 5000,在 FindSPPPortIndex 函数里if(SPPContextInfo[i].LocalSerialPortID == SerialPortID)条件终于满足了,但是!这样返回的就是0,SniffMode()里if(((SerialPortIndex = FindSPPPortIndex(LocalSerialPortID)) >= 0) 条件又不满足,又卡住了。。TI的员工们,请来回答一下好吗?
bo xu6:
回复 bo xu6:
sniffmode的使用真的没有什么好的文档,第一次弄全无头绪。我开启了服务后(Open 9),Server Opened: Server Port 9,Serial Port ID 1,所以我终于找到了这个所谓的Serial port ID ,然后我输入SniffMode 1 500 48 30 5000,在 FindSPPPortIndex 函数里if(SPPContextInfo[i].LocalSerialPortID == SerialPortID)条件终于满足了,但是!这样返回的就是0,SniffMode()里if(((SerialPortIndex = FindSPPPortIndex(LocalSerialPortID)) >= 0) 条件又不满足,又卡住了。。TI的员工们,请来回答一下好吗?
bo xu6:
回复 bo xu6:
if(((SerialPortIndex = FindSPPPortIndex(LocalSerialPortID)) >= 0) && (SPPContextInfo[SerialPortIndex].Connection_Handle))这个判断条件前半段是满足了,后半段在调试内存观察框了看见值为0,所以不行。按照程序的意思,这个值应该非零,那么该怎么获得非零值呢?