@@ -546,3 +546,104 @@ def writeCharaDesc(connect_id, handle, data):
546546 :param data:Bytearray type. Characteristic description data.
547547 :return:0- Successful execution; -1- Failed execution.
548548 """
549+
550+
551+ def exchangeMtu (self , connect_id , mtu_size ):
552+ """Send MTU exchange request.
553+
554+ The MTU exchange request should be initiated by the client side.
555+
556+ :param connect_id: Connection ID, obtained when establishing the connection, integer type.
557+ :param mtu_size: MTU size.
558+ :return: 0 on success, -1 on failure.
559+ """
560+
561+ def smpSetConfig (self , io_cap , auth_req , passkey , timeout ):
562+ """Configure pairing capabilities.
563+
564+ Pairing method selection process:
565+ There are two modes for BLE SMP pairing: Legacy Pairing and Secure Connections Pairing.
566+ The specific pairing method is determined through negotiation between the two parties after
567+ exchanging their IO capabilities.
568+
569+ :param io_cap: Device input/output capability, integer type, default 3.
570+ Value Meaning
571+ 0 Display only, can display PIN code
572+ 1 Display only, can only display Yes/No, cannot display PIN code
573+ 2 Input only, can input PIN code
574+ 3 No input/output capability (default)
575+ 4 Both input and output capabilities
576+ :param auth_req: Authentication request parameter, integer type, default 9.
577+ Bit0 Bit1 Bit2 Bit3
578+ 0 No binding after pairing Reserved Disable MITM Use Legacy Pairing
579+ 1 Bind after pairing Reserved Enable MITM Use Secure Connections Pairing
580+ :param passkey: PIN code to display during pairing, integer type, default 123456.
581+ :param timeout: Pairing timeout, in units of 100ms, integer type, default 160.
582+ :return: 0 on success, -1 on failure.
583+ """
584+
585+ def smpGetConfig (self ):
586+ """Query pairing capabilities.
587+
588+ :return: On success, returns a tuple (io_cap, auth_req, passkey, timeout).
589+ On failure, returns -1.
590+
591+ io_cap - Device input/output capability, integer type, default 3.
592+ Value Meaning
593+ 0 Display only, can display PIN code
594+ 1 Display only, can only display Yes/No, cannot display PIN code
595+ 2 Input only, can input PIN code
596+ 3 No input/output capability
597+ 4 Both input and output capabilities
598+ auth_req - Authentication request parameter, integer type, default 9.
599+ Bit0 Bit1 Bit2 Bit3
600+ 0 No binding after pairing Reserved Disable MITM Use Legacy Pairing
601+ 1 Bind after pairing Reserved Enable MITM Use Secure Connections Pairing
602+ passkey - PIN code to display during pairing, integer type, default 123456.
603+ timeout - Pairing timeout, in units of 100ms, integer type, default 160.
604+ """
605+
606+ def smpStartPair (self , connect_id ):
607+ """Start the BLE SMP pairing process.
608+
609+ SMP pairing is initiated by the client, but the server can also use this interface
610+ to notify the client to initiate an SMP pairing request.
611+
612+ :param connect_id: Connection ID, obtained when establishing the connection, integer type.
613+ :return: 0 on success, -1 on failure.
614+ """
615+
616+ def smpUserConfirm (self , connect_id , pair_operation , pin ):
617+ """Confirm pairing.
618+
619+ After receiving a pairing request, confirm whether to accept the pairing.
620+
621+ :param connect_id: Connection ID, obtained when establishing the connection, integer type.
622+ :param pair_operation: Pairing operation type, integer type.
623+ Value Meaning
624+ 0 Cancel pairing (only available during pairing process; will disconnect the BLE connection)
625+ 1 Confirm pairing without PIN (for Just Work or Numeric Comparison modes)
626+ 2 Confirm pairing with PIN (for Passkey mode)
627+ :param pin: PIN code, integer type.
628+ :return: 0 on success, -1 on failure.
629+ """
630+
631+ def smpGetPairedDevInfo (self ):
632+ """Get information about paired devices.
633+
634+ :return: On success, returns a list of bytearray objects representing BLE addresses of paired devices.
635+ On failure, returns -1.
636+ """
637+
638+ def smpRemovePairedDev (self , addr ):
639+ """Delete information for a specified paired device.
640+
641+ :param addr: BLE address of the device to be deleted, bytearray type (6 bytes).
642+ :return: 0 on success, -1 on failure.
643+ """
644+
645+ def smpCleanPairedDev (self ):
646+ """Delete information for all paired devices.
647+
648+ :return: 0 on success, -1 on failure.
649+ """
0 commit comments