Giter Site home page Giter Site logo

Comments (9)

brycejacobs avatar brycejacobs commented on September 9, 2024

@Cierpliwy Any update on the base64 API? Is there any consideration to disabling the encoding / decoding?

We have a scenario with some embedded devices, running on a TI cc2650, that is fighting for bytes. The base64 encoding / decoding is a killer for when you want to send raw bytes across the wire.

from react-native-ble-plx.

Cierpliwy avatar Cierpliwy commented on September 9, 2024

In our internal project we are currently doing Data -> Base64 -> Data which is definitely suboptimal and I would love to remove that step for library. RN team doesn't seem to work on it unfortunately:
facebook/react-native#1424.

Maybe I could check if it is difficult to add binary bridging between JSC and native modules, but to be honest I don't have so much time at my disposal.

As a side note: still when you are passing Base64 to API calls it is converted to binary form by native libraries used by react-native-ble-plx and then send to BLE radio. So you can definitely manipulate bytes and there is only Data -> Base64 -> Data inefficiency during bridging.

from react-native-ble-plx.

brycejacobs avatar brycejacobs commented on September 9, 2024

Hm, maybe I read the source wrong.

I was under the assumption, that if I were to read a characteristic on a remote peripheral, that the library assumes the data received is in base64. Is this correct? If it's simply reading the data, then encoding to base64 for the trip back to js land then that should be fine, and may actually be the best way.

The scenario that I'm in, is where I have a device out in the wild that's broadcasting some advertisement data when not connected, that serves as service data, that contains some status values. I actually just booted back up the prototype, let me test my theory and get back to you before I waste any more time.

from react-native-ble-plx.

Cierpliwy avatar Cierpliwy commented on September 9, 2024

Data is read from peripheral in binary form and converted to Base64 only when it needs to be sent to JS side, so everything should be fine.

from react-native-ble-plx.

rclai avatar rclai commented on September 9, 2024

Yeah, you don't have to send base64 data to your TI cc2650.

from react-native-ble-plx.

jchirschy avatar jchirschy commented on September 9, 2024

Hi @Cierpliwy,

As I read this issue, could you confirm that data written to or read from a characteristic is not base64 encoded ? That means, peripheral doesn't need to encode or decode base64 ?

from react-native-ble-plx.

Cierpliwy avatar Cierpliwy commented on September 9, 2024

@jchirschy That's correct

from react-native-ble-plx.

brycejacobs avatar brycejacobs commented on September 9, 2024

from react-native-ble-plx.

Cierpliwy avatar Cierpliwy commented on September 9, 2024

Closing in favour of #299

from react-native-ble-plx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.