4343//| """There is no regular constructor for a Descriptor. A new local Descriptor can be created
4444//| and attached to a Characteristic by calling `add_to_characteristic()`.
4545//| Remote Descriptor objects are created by `Connection.discover_remote_services()`
46- //| as part of remote Characteristics in the remote Services that are discovered.
46+ //| as part of remote Characteristics in the remote Services that are discovered."""
4747//|
48- //| .. classmethod:: add_to_characteristic(characteristic, uuid, *, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=b'')
48+ //| @classmethod
49+ //| def add_to_characteristic(characteristic: Characteristic, uuid: UUID, *, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length = 20, fixed_length: bool = False, initial_value: ReadableBuffer = b'') -> Descriptor:
50+ //| """Create a new Descriptor object, and add it to this Service.
4951//|
50- //| Create a new Descriptor object, and add it to this Service.
52+ //| :param Characteristic characteristic: The characteristic that will hold this descriptor
53+ //| :param UUID uuid: The uuid of the descriptor
54+ //| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which
55+ //| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`,
56+ //| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`,
57+ //| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`.
58+ //| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which
59+ //| security mode is required. Values allowed are the same as ``read_perm``.
60+ //| :param int max_length: Maximum length in bytes of the descriptor value. The maximum allowed is
61+ //| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
62+ //| number of data bytes that fit in a single BLE 4.x ATT packet.
63+ //| :param bool fixed_length: True if the descriptor value is of fixed length.
64+ //| :param buf initial_value: The initial value for this descriptor.
5165//|
52- //| :param Characteristic characteristic: The characteristic that will hold this descriptor
53- //| :param UUID uuid: The uuid of the descriptor
54- //| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which
55- //| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`,
56- //| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`,
57- //| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`.
58- //| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which
59- //| security mode is required. Values allowed are the same as ``read_perm``.
60- //| :param int max_length: Maximum length in bytes of the descriptor value. The maximum allowed is
61- //| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
62- //| number of data bytes that fit in a single BLE 4.x ATT packet.
63- //| :param bool fixed_length: True if the descriptor value is of fixed length.
64- //| :param buf initial_value: The initial value for this descriptor.
65- //|
66- //| :return: the new Descriptor."""
66+ //| :return: the new Descriptor."""
6767//| ...
6868//|
6969STATIC mp_obj_t bleio_descriptor_add_to_characteristic (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
@@ -132,7 +132,7 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o
132132STATIC MP_DEFINE_CONST_FUN_OBJ_KW (bleio_descriptor_add_to_characteristic_fun_obj , 3 , bleio_descriptor_add_to_characteristic );
133133STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ (bleio_descriptor_add_to_characteristic_obj , MP_ROM_PTR (& bleio_descriptor_add_to_characteristic_fun_obj ));
134134
135- //| uuid: UUID = ...
135+ //| uuid: UUID
136136//| """The descriptor uuid. (read-only)"""
137137//|
138138STATIC mp_obj_t bleio_descriptor_get_uuid (mp_obj_t self_in ) {
@@ -150,7 +150,7 @@ const mp_obj_property_t bleio_descriptor_uuid_obj = {
150150 (mp_obj_t )& mp_const_none_obj },
151151};
152152
153- //| characteristic: Characteristic = ...
153+ //| characteristic: Characteristic
154154//| """The Characteristic this Descriptor is a part of."""
155155//|
156156STATIC mp_obj_t bleio_descriptor_get_characteristic (mp_obj_t self_in ) {
@@ -167,7 +167,7 @@ const mp_obj_property_t bleio_descriptor_characteristic_obj = {
167167 (mp_obj_t )& mp_const_none_obj },
168168};
169169
170- //| value: WriteableBuffer = ...
170+ //| value: bytearray
171171//| """The value of this descriptor."""
172172//|
173173STATIC mp_obj_t bleio_descriptor_get_value (mp_obj_t self_in ) {
0 commit comments