- Add PinCode command replies
- Add CancelInquiry command git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25942 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -19,6 +19,9 @@ void* buildAuthEnable(uint8 auth, size_t* outsize);
|
|||||||
/* LINK CONTROL */
|
/* LINK CONTROL */
|
||||||
void* buildRemoteNameRequest(bdaddr_t bdaddr,uint8 pscan_rep_mode, uint16 clock_offset, size_t* outsize);
|
void* buildRemoteNameRequest(bdaddr_t bdaddr,uint8 pscan_rep_mode, uint16 clock_offset, size_t* outsize);
|
||||||
void* buildInquiry(uint32 lap, uint8 length, uint8 num_rsp, size_t* outsize);
|
void* buildInquiry(uint32 lap, uint8 length, uint8 num_rsp, size_t* outsize);
|
||||||
|
void* buildInquiryCancel(size_t* outsize);
|
||||||
|
void* buildPinCodeRequestReply(bdaddr_t bdaddr, uint8 length, char pincode[16], size_t* outsize);
|
||||||
|
void* buildPinCodeRequestNegativeReply(bdaddr_t bdaddr, uint8 length, char pincode[16], size_t* outsize);
|
||||||
|
|
||||||
/* OGF_INFORMATIONAL_PARAM */
|
/* OGF_INFORMATIONAL_PARAM */
|
||||||
void* buildReadBufferSize(size_t* outsize);
|
void* buildReadBufferSize(size_t* outsize);
|
||||||
|
|||||||
@@ -144,10 +144,10 @@ void* buildInquiry(uint32 lap, uint8 length, uint8 num_rsp, size_t* outsize)
|
|||||||
struct hci_cp_inquiry* param;
|
struct hci_cp_inquiry* param;
|
||||||
void* command = buildCommand(OGF_LINK_CONTROL, OCF_INQUIRY, (void**) ¶m, sizeof(struct hci_cp_inquiry), outsize);
|
void* command = buildCommand(OGF_LINK_CONTROL, OCF_INQUIRY, (void**) ¶m, sizeof(struct hci_cp_inquiry), outsize);
|
||||||
|
|
||||||
if (command != NULL) {
|
if (command != NULL) {
|
||||||
|
|
||||||
param->lap[2] = (lap >> 16) & 0xFF;
|
param->lap[2] = (lap >> 16) & 0xFF;
|
||||||
param->lap[1] = (lap >> 8) & 0xFF;
|
param->lap[1] = (lap >> 8) & 0xFF;
|
||||||
param->lap[0] = (lap >> 0) & 0xFF;
|
param->lap[0] = (lap >> 0) & 0xFF;
|
||||||
param->length = length;
|
param->length = length;
|
||||||
param->num_rsp = num_rsp;
|
param->num_rsp = num_rsp;
|
||||||
@@ -156,6 +156,53 @@ void* buildInquiry(uint32 lap, uint8 length, uint8 num_rsp, size_t* outsize)
|
|||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* buildInquiryCancel(size_t* outsize)
|
||||||
|
{
|
||||||
|
|
||||||
|
return buildCommand(OGF_LINK_CONTROL, OCF_INQUIRY_CANCEL, NULL, 0, outsize);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void* buildPinCodeRequestReply(bdaddr_t bdaddr, uint8 length, char pincode[16], size_t* outsize)
|
||||||
|
{
|
||||||
|
|
||||||
|
struct hci_cp_pin_code_reply* param;
|
||||||
|
|
||||||
|
if (length > HCI_PIN_SIZE) // PinCode cannot be longer than 16
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
void* command = buildCommand(OGF_LINK_CONTROL, OCF_PIN_CODE_REPLY, (void**) ¶m, sizeof(struct hci_cp_pin_code_reply), outsize);
|
||||||
|
|
||||||
|
if (command != NULL) {
|
||||||
|
|
||||||
|
param->bdaddr = bdaddr;
|
||||||
|
param->pin_len = length;
|
||||||
|
memcpy(¶m->pin_code, pincode, length);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void* buildPinCodeRequestNegativeReply(bdaddr_t bdaddr, uint8 length, char pincode[16], size_t* outsize)
|
||||||
|
{
|
||||||
|
|
||||||
|
struct hci_cp_pin_code_neg_reply* param;
|
||||||
|
|
||||||
|
void* command = buildCommand(OGF_LINK_CONTROL, OCF_PIN_CODE_NEG_REPLY,
|
||||||
|
(void**) ¶m, sizeof(struct hci_cp_pin_code_neg_reply), outsize);
|
||||||
|
|
||||||
|
if (command != NULL) {
|
||||||
|
|
||||||
|
param->bdaddr = bdaddr;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#pragma mark - INFORMATIONAL_PARAM -
|
#pragma mark - INFORMATIONAL_PARAM -
|
||||||
|
|||||||
Reference in New Issue
Block a user