Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zhanguangao opened this issue Dec 15, 2016 · 6 comments
Closed

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

zhanguangao opened this issue Dec 15, 2016 · 6 comments
Labels

Comments

@zhanguangao
Copy link

No description provided.

@marcosinigaglia
Copy link
Member

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

@zhanguangao
Copy link
Author

Can I modify the source code to send hexadecimal ?

@marcosinigaglia
Copy link
Member

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

@zhanguangao
Copy link
Author

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

@marcosinigaglia
Copy link
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
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants