-
-
Notifications
You must be signed in to change notification settings - Fork 90
Add wireless controller syncing functionality to WPAD/LWBT #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
2b918cd
60df481
b1b84fd
ccfe267
e096919
d0d0191
57f2921
3cb9d09
4d5665a
56bda29
eea5f61
86704a6
7e34671
545eeeb
4406038
caedcc1
aa35f0e
46a5496
ad5b3d7
6fed5dc
2322b93
b7cd820
ddb380d
4f8f311
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,18 +56,27 @@ | |
#define HIDP_CTRL_VC_UNPLUG 0x05 | ||
|
||
/* HIDP data transaction headers */ | ||
#define HIDP_DATA_RTYPE_MASK 0x03 | ||
#define HIDP_DATA_RSRVD_MASK 0x0c | ||
#define HIDP_DATA_RTYPE_OTHER 0x00 | ||
#define HIDP_DATA_RTYPE_INPUT 0x01 | ||
#define HIDP_DATA_RTYPE_OUPUT 0x02 | ||
#define HIDP_DATA_RTYPE_FEATURE 0x03 | ||
#define HIDP_DATA_RTYPE_MASK 0x03 | ||
#define HIDP_DATA_RSRVD_MASK 0x0c | ||
#define HIDP_DATA_RTYPE_OTHER 0x00 | ||
#define HIDP_DATA_RTYPE_INPUT 0x01 | ||
#define HIDP_DATA_RTYPE_OUPUT 0x02 | ||
#define HIDP_DATA_RTYPE_FEATURE 0x03 | ||
|
||
#define HIDP_PROTO_BOOT 0x00 | ||
#define HIDP_PROTO_REPORT 0x01 | ||
|
||
#define BD_LINK_KEY_LEN 16 | ||
#define BD_NAME_LEN 248 | ||
#define BD_MAX_INQUIRY_DEVS 255 | ||
|
||
enum pair_mode { | ||
PAIR_MODE_NORMAL, | ||
PAIR_MODE_TEMPORARY | ||
}; | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
extern "C" { | ||
#endif /* __cplusplus */ | ||
|
||
struct l2cap_pcb; | ||
|
@@ -88,10 +97,22 @@ struct inquiry_info_ex | |
u16 co; | ||
}; | ||
|
||
struct inquiry_res | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest prefixing structures with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I assume like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. |
||
{ | ||
u8 count; | ||
struct inquiry_info_ex *info; | ||
}; | ||
|
||
struct linkkey_info | ||
{ | ||
struct bd_addr bdaddr; | ||
u8 key[16]; | ||
u8 key[BD_LINK_KEY_LEN]; | ||
}; | ||
|
||
struct pad_name_info | ||
{ | ||
struct bd_addr bdaddr; | ||
u8 name[BD_NAME_LEN]; | ||
}; | ||
|
||
struct bte_pcb | ||
|
@@ -112,6 +133,7 @@ struct bte_pcb | |
|
||
|
||
s32 (*recv)(void *arg,void *buffer,u16 len); | ||
s32 (*conn_req)(void *arg,struct bte_pcb *pcb,struct bd_addr *bdaddr,u8 *cod,u8 link_type,u8 err); | ||
s32 (*conn_cfm)(void *arg,struct bte_pcb *pcb,u8 err); | ||
s32 (*disconn_cfm)(void *arg,struct bte_pcb *pcb,u8 err); | ||
}; | ||
|
@@ -120,34 +142,47 @@ typedef s32 (*btecallback)(s32 result,void *userdata); | |
|
||
void BTE_Init(void); | ||
void BTE_Shutdown(void); | ||
void BTE_Close(void); | ||
s32 BTE_InitCore(btecallback cb); | ||
s32 BTE_ApplyPatch(btecallback cb); | ||
s32 BTE_InitSub(btecallback cb); | ||
s32 BTE_ReadStoredLinkKey(struct linkkey_info *keys,u8 max_cnt,btecallback cb); | ||
s32 BTE_ReadBdAddr(struct bd_addr *bdaddr, btecallback cb); | ||
s32 BTE_SetEvtFilter(u8 filter_type,u8 filter_cond_type,u8 *cond, btecallback cb); | ||
s32 BTE_ReadRemoteName(struct pad_name_info *padinfo, btecallback cb); | ||
s32 BTE_Inquiry(u8 max_cnt,u8 flush, btecallback cb); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not use the existing btecallback, because that forces us to pass the result in the typedef s32 (*bte_inquiry_callback)(s32 result, bte_inquiry_res *res, void *userdata); or, actually better, move the s32 result inside bte_inquiry_res (or we can change typedef s32 (*bte_inquiry_callback)(bte_inquiry_res *res, void *userdata); I haven't check the rest of the new functions, but please consider allowing the client to receive its own userdata. |
||
s32 BTE_PeriodicInquiry(u8 max_cnt,u8 flush,btecallback cb); | ||
s32 BTE_ExitPeriodicInquiry(void); | ||
s32 BTE_LinkKeyRequestReply(struct bd_addr *bdaddr,u8 *key); | ||
s32 BTE_LinkKeyRequestNegativeReply(struct bd_addr *bdaddr); | ||
void (*BTE_SetDisconnectCallback(void (*callback)(struct bd_addr *bdaddr,u8 reason)))(struct bd_addr *bdaddr,u8 reason); | ||
void BTE_SetHostSyncButtonCallback(void (*callback)(u32 held)); | ||
void BTE_SetConnectionRequestCallback(s8 (*callback)(void *arg,struct bd_addr *bdaddr,u8 *cod,u8 link_type)); | ||
void BTE_SetLinkKeyRequestCallback(s8 (*callback)(void *arg,struct bd_addr *bdaddr)); | ||
void BTE_SetLinkKeyNotificationCallback(s8 (*callback)(void *arg,struct bd_addr *bdaddr,u8 *key)); | ||
u8 BTE_GetPairMode(void); | ||
s32 BTE_WriteStoredLinkKey(struct bd_addr *bdaddr,u8 *key); | ||
s32 BTE_ClearStoredLinkKeys(void); | ||
s32 BTE_DeleteStoredLinkKey(struct bd_addr *bdaddr); | ||
|
||
struct bte_pcb* bte_new(void); | ||
void bte_free(struct bte_pcb *pcb); | ||
void bte_arg(struct bte_pcb *pcb,void *arg); | ||
void bte_received(struct bte_pcb *pcb, s32 (*recv)(void *arg,void *buffer,u16 len)); | ||
void bte_disconnected(struct bte_pcb *pcb,s32 (disconn_cfm)(void *arg,struct bte_pcb *pcb,u8 err)); | ||
|
||
s32 bte_registerdeviceasync(struct bte_pcb *pcb,struct bd_addr *bdaddr,s32 (*conn_cfm)(void *arg,struct bte_pcb *pcb,u8 err)); | ||
|
||
s32 bte_disconnect(struct bte_pcb *pcb); | ||
|
||
//s32 bte_listen(struct bte_pcb *pcb,struct bd_addr *bdaddr,u8 psm); | ||
//s32 bte_accept(struct bte_pcb *pcb,s32 (*recv)(void *arg,void *buffer,u16 len)); | ||
s32 bte_inquiry(struct inquiry_info *info,u8 max_cnt,u8 flush); | ||
s32 bte_inquiry_ex(struct inquiry_info_ex *info,u8 max_cnt,u8 flush); | ||
//s32 bte_connect(struct bte_pcb *pcb,struct bd_addr *bdaddr,u8 psm,s32 (*recv)(void *arg,void *buffer,u16 len)); | ||
//s32 bte_connect_ex(struct bte_pcb *pcb,struct inquiry_info_ex *info,u8 psm,s32 (*recv)(void *arg,void *buffer,u16 len)); | ||
s32 bte_listenasync(struct bte_pcb *pcb,struct bd_addr *bdaddr,s32 (*conn_cfm)(void *arg,struct bte_pcb *pcb,u8 err)); | ||
s32 bte_listenasync_step2(struct bte_pcb *pcb,s32 (*conn_cfm)(void *arg,struct bte_pcb *pcb,u8 err)); | ||
s32 bte_connectasync(struct bte_pcb *pcb,struct bd_addr *bdaddr,s32 (*conn_cfm)(void *arg,struct bte_pcb *pcb,u8 err)); | ||
s32 bte_connectasync_step2(struct bte_pcb *pcb,s32 (*conn_cfm)(void *arg,struct bte_pcb *pcb,u8 err)); | ||
s32 bte_senddata(struct bte_pcb *pcb,void *message,u16 len); | ||
s32 bte_sendmessage(struct bte_pcb *pcb,void *message,u16 len); | ||
s32 bte_sendmessageasync(struct bte_pcb *pcb,void *message,u16 len,s32 (*sent)(void *arg,struct bte_pcb *pcb,u8 err)); | ||
|
||
#ifdef __cplusplus | ||
} | ||
} | ||
#endif /* __cplusplus */ | ||
|
||
#endif | ||
|
Uh oh!
There was an error while loading. Please reload this page.