Skip to content

Can I send hexadecimal data to BLE instead of base64 format? #87

Closed
@zhanguangao

Description

@zhanguangao
No description provided.

Activity

marcosinigaglia

marcosinigaglia commented on Dec 15, 2016

@marcosinigaglia
Member

Hi, for now you have to convert in the base64.

zhanguangao

zhanguangao commented on Dec 16, 2016

@zhanguangao
Author

Can I modify the source code to send hexadecimal ?

marcosinigaglia

marcosinigaglia commented on Dec 16, 2016

@marcosinigaglia
Member

I don't understand the problem, you can convert you hexadecimal value in base64.

zhanguangao

zhanguangao commented on Dec 16, 2016

@zhanguangao
Author

Because of the BLE device only analysis the hexadecimal value, so I only to send hexadecimal value.

marcosinigaglia

marcosinigaglia commented on Dec 16, 2016

@marcosinigaglia
Member

The base64 is only the way to send bytes from javascript to the native part of the module, the module reconvert the base64 string in bytes and write to the device.

zhanguangao

zhanguangao commented on Dec 17, 2016

@zhanguangao
Author

I change the source code to send String value, and transform string to byte array as parameter to peripheral.write(),and transform byte to hexadecimal byte array as parameter to characteristic.setValue(), finally the BLE device successfully read the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @marcosinigaglia@zhanguangao

        Issue actions

          Can I send hexadecimal data to BLE instead of base64 format? · Issue #87 · innoveit/react-native-ble-manager