mirror of
https://github.com/google/bumble.git
synced 2026-07-04 12:40:49 +00:00
formatting and linting automation
Squashed commits: [cd479ba] formatting and linting automation [7fbfabb] formatting and linting automation [c4f9505] fix after rebase [f506ad4] rename job [441d517] update doc (+7 squashed commits) [2e1b416] fix invoke and github action [6ae5bb4] doc for git blame [44b5461] add GitHub action [b07474f] add docs [4cd9a6f] more linter fixes [db71901] wip [540dc88] wip
This commit is contained in:
+47
-1
@@ -15,10 +15,55 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# Imports
|
||||
# -----------------------------------------------------------------------------
|
||||
from bumble.hci import *
|
||||
|
||||
from bumble.hci import (
|
||||
HCI_DISCONNECT_COMMAND,
|
||||
HCI_LE_1M_PHY_BIT,
|
||||
HCI_LE_CODED_PHY_BIT,
|
||||
HCI_LE_READ_BUFFER_SIZE_COMMAND,
|
||||
HCI_RESET_COMMAND,
|
||||
HCI_SUCCESS,
|
||||
Address,
|
||||
HCI_Command,
|
||||
HCI_Command_Complete_Event,
|
||||
HCI_Command_Status_Event,
|
||||
HCI_CustomPacket,
|
||||
HCI_Disconnect_Command,
|
||||
HCI_Event,
|
||||
HCI_LE_Add_Device_To_Filter_Accept_List_Command,
|
||||
HCI_LE_Advertising_Report_Event,
|
||||
HCI_LE_Channel_Selection_Algorithm_Event,
|
||||
HCI_LE_Connection_Complete_Event,
|
||||
HCI_LE_Connection_Update_Command,
|
||||
HCI_LE_Connection_Update_Complete_Event,
|
||||
HCI_LE_Create_Connection_Command,
|
||||
HCI_LE_Extended_Create_Connection_Command,
|
||||
HCI_LE_Read_Buffer_Size_Command,
|
||||
HCI_LE_Read_Remote_Features_Command,
|
||||
HCI_LE_Read_Remote_Features_Complete_Event,
|
||||
HCI_LE_Remove_Device_From_Filter_Accept_List_Command,
|
||||
HCI_LE_Set_Advertising_Data_Command,
|
||||
HCI_LE_Set_Advertising_Parameters_Command,
|
||||
HCI_LE_Set_Default_PHY_Command,
|
||||
HCI_LE_Set_Event_Mask_Command,
|
||||
HCI_LE_Set_Extended_Scan_Parameters_Command,
|
||||
HCI_LE_Set_Random_Address_Command,
|
||||
HCI_LE_Set_Scan_Enable_Command,
|
||||
HCI_LE_Set_Scan_Parameters_Command,
|
||||
HCI_Number_Of_Completed_Packets_Event,
|
||||
HCI_Packet,
|
||||
HCI_Read_Local_Supported_Commands_Command,
|
||||
HCI_Read_Local_Supported_Features_Command,
|
||||
HCI_Read_Local_Version_Information_Command,
|
||||
HCI_Reset_Command,
|
||||
HCI_Set_Event_Mask_Command,
|
||||
)
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
|
||||
def basic_check(x):
|
||||
packet = x.to_bytes()
|
||||
print(packet.hex())
|
||||
@@ -345,6 +390,7 @@ def test_HCI_LE_Set_Default_PHY_Command():
|
||||
def test_HCI_LE_Set_Extended_Scan_Parameters_Command():
|
||||
command = HCI_LE_Set_Extended_Scan_Parameters_Command(
|
||||
own_address_type=Address.RANDOM_DEVICE_ADDRESS,
|
||||
# pylint: disable-next=line-too-long
|
||||
scanning_filter_policy=HCI_LE_Set_Extended_Scan_Parameters_Command.BASIC_FILTERED_POLICY,
|
||||
scanning_phys=(1 << HCI_LE_1M_PHY_BIT | 1 << HCI_LE_CODED_PHY_BIT | 1 << 4),
|
||||
scan_types=[
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
[pytest]
|
||||
junit_logging = all
|
||||
asyncio_mode = auto
|
||||
asyncio_mode = auto
|
||||
|
||||
+4
-1
@@ -15,9 +15,12 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# Imports
|
||||
# -----------------------------------------------------------------------------
|
||||
from bumble.sdp import *
|
||||
from bumble.core import UUID
|
||||
from bumble.sdp import DataElement
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# pylint: disable=invalid-name
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def basic_check(x):
|
||||
|
||||
+2
-2
@@ -298,7 +298,7 @@ async def test_self_smp(io_cap, sc, mitm, key_dist):
|
||||
|
||||
async def compare_numbers(self, number, digits):
|
||||
if self.peer_delegate is None:
|
||||
logger.warn(f'[{self.name}] no peer delegate')
|
||||
logger.warning(f'[{self.name}] no peer delegate')
|
||||
return False
|
||||
await self.display_number(number, digits=6)
|
||||
logger.debug(f'[{self.name}] waiting for peer number')
|
||||
@@ -308,7 +308,7 @@ async def test_self_smp(io_cap, sc, mitm, key_dist):
|
||||
|
||||
async def get_number(self):
|
||||
if self.peer_delegate is None:
|
||||
logger.warn(f'[{self.name}] no peer delegate')
|
||||
logger.warning(f'[{self.name}] no peer delegate')
|
||||
return 0
|
||||
else:
|
||||
if (
|
||||
|
||||
+7
-3
@@ -15,12 +15,16 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# Imports
|
||||
# -----------------------------------------------------------------------------
|
||||
from bumble.crypto import *
|
||||
|
||||
from bumble.crypto import EccKey, aes_cmac, ah, c1, f4, f5, f6, g2, h6, h7, s1
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def reversed_hex(hex):
|
||||
return bytes(reversed(bytes.fromhex(hex)))
|
||||
# pylint: disable=invalid-name
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def reversed_hex(hex_str):
|
||||
return bytes(reversed(bytes.fromhex(hex_str)))
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user