diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-08-06 22:55:25 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2019-08-06 22:55:25 -0400 |
| commit | d74c8b9425d38fe2dce56e044b128ab5693f5f06 (patch) | |
| tree | 2b53e13d4bcf7333225c45c16513f86f1d9c9449 /shared-bindings/bleio/Address.c | |
| parent | 243334da75bb765781aedef0b9927af72f6279e8 (diff) | |
WIP: more Descriptor work; refactor gattc/gatts read/write
Diffstat (limited to 'shared-bindings/bleio/Address.c')
| -rw-r--r-- | shared-bindings/bleio/Address.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/shared-bindings/bleio/Address.c b/shared-bindings/bleio/Address.c index d77cfa404..baeb6d7c0 100644 --- a/shared-bindings/bleio/Address.c +++ b/shared-bindings/bleio/Address.c @@ -83,7 +83,21 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, //| .. attribute:: address_bytes //| -//| The bytes that make up the device address (read-only) +//| The bytes that make up the device address (read-only). +//| +//| Note that the ``bytes`` object returned is in little-endian order: +//| The least significant byte is ``address_bytes[0]``. So the address will +//| appear to be reversed if you print the raw ``bytes`` object. If you print +//| or use `str()` on the :py:class:`~bleio.Attribute` object itself, the address will be printed +//| in the expected order. For example: +//| +//| .. code-block:: pycon +//| +//| >>> import bleio +//| >>> bleio.adapter.address +//| <Address c8:1d:f5:ed:a8:35> +//| >>> bleio.adapter.address.address_bytes +//| b'5\xa8\xed\xf5\x1d\xc8' //| STATIC mp_obj_t bleio_address_get_address_bytes(mp_obj_t self_in) { bleio_address_obj_t *self = MP_OBJ_TO_PTR(self_in); |
