Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- hidemukbd.orig.c Thu Aug 15 14:28:40 2013
- +++ hidemukbd.c Sun May 21 15:28:37 2017
- @@ -216,7 +216,7 @@
- static void hidEmuKbd_ProcessOSALMsg( osal_event_hdr_t *pMsg );
- static void hidEmuKbd_HandleKeys( uint8 shift, uint8 keys );
- -static void hidEmuKbdSendReport( uint8 keycode );
- +static void hidEmuKbdSendReport( uint8 modifier, uint8 keycode );
- static void hidEmuKbdSendMouseReport( uint8 buttons );
- static uint8 hidEmuKbdRcvReport( uint8 len, uint8 *pData );
- static uint8 hidEmuKbdRptCB( uint8 id, uint8 type, uint16 uuid,
- @@ -261,7 +261,7 @@
- // Setup the GAP Peripheral Role Profile
- {
- - uint8 initial_advertising_enable = FALSE;
- + uint8 initial_advertising_enable = TRUE;
- // By setting this to zero, the device will go into the waiting state after
- // being discoverable for 30.72 second, and will not being advertising again
- @@ -293,11 +293,11 @@
- // Setup the GAP Bond Manager
- {
- - uint32 passkey = DEFAULT_PASSCODE;
- - uint8 pairMode = DEFAULT_PAIRING_MODE;
- - uint8 mitm = DEFAULT_MITM_MODE;
- - uint8 ioCap = DEFAULT_IO_CAPABILITIES;
- - uint8 bonding = DEFAULT_BONDING_MODE;
- + uint32 passkey = 0; // passkey "000000"
- + uint8 pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
- + uint8 mitm = FALSE;
- + uint8 ioCap = GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT;
- + uint8 bonding = TRUE;
- GAPBondMgr_SetParameter( GAPBOND_DEFAULT_PASSCODE, sizeof( uint32 ), &passkey );
- GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof( uint8 ), &pairMode );
- GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof( uint8 ), &mitm );
- @@ -433,13 +433,13 @@
- if ( (keys & HAL_KEY_SW_1) && (prevKey1 == 0) )
- {
- // pressed
- - hidEmuKbdSendReport( KEY_LEFT_ARROW );
- + hidEmuKbdSendReport( 0, KEY_LEFT_ARROW );
- prevKey1 = 1;
- }
- else if ( !(keys & HAL_KEY_SW_1) && (prevKey1 == 1) )
- {
- // released
- - hidEmuKbdSendReport( KEY_NONE );
- + hidEmuKbdSendReport( 0, KEY_NONE );
- prevKey1 = 0;
- }
- @@ -448,7 +448,7 @@
- // pressed
- if ( !hidBootMouseEnabled )
- {
- - hidEmuKbdSendReport( KEY_RIGHT_ARROW );
- + hidEmuKbdSendReport( 0x80, KEY_NONE ); // winkey
- }
- else
- {
- @@ -461,7 +461,7 @@
- // released
- if ( !hidBootMouseEnabled )
- {
- - hidEmuKbdSendReport( KEY_NONE );
- + hidEmuKbdSendReport( 0, KEY_NONE );
- }
- else
- {
- @@ -480,11 +480,11 @@
- *
- * @return none
- */
- -static void hidEmuKbdSendReport( uint8 keycode )
- +static void hidEmuKbdSendReport( uint8 modifier, uint8 keycode )
- {
- uint8 buf[HID_KEYBOARD_IN_RPT_LEN];
- - buf[0] = 0; // Modifier keys
- + buf[0] = modifier; // Modifier keys
- buf[1] = 0; // Reserved
- buf[2] = keycode; // Keycode 1
- buf[3] = 0; // Keycode 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement