Coder Social home page Coder Social logo

Comments (4)

m-murillo avatar m-murillo commented on August 20, 2024

Hello.

By mistake I closed the issue, sorry.

I updated the node v8.10.0 to v16.18.0.

I still have the same errors without the code I added before.

  • In the example of README.md (hello advlib-ble-manufacturers) it returns null.
  • In advlibblemanufacturers.test.js:
describe('advlib-ble-manufacturers', function() {
^

ReferenceError: describe is not defined
    at Object.<anonymous> (/home/.../node_modules/advlib-ble-manufacturers/test/unit/advlibblemanufacturers.test.js:29:1)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47

Thank you.

from advlib-ble-manufacturers.

m-murillo avatar m-murillo commented on August 20, 2024

Hello again!

I was watching where was the mistake in the example of README.md (hello advlib-ble-manufacturers) and it's on function processIBeacon (/home/.../node_modules/advlib-ble-manufacturers/lib/apple.js:75). It seems the variable isInvalidLength = true because:

let isInvalidLength = (data.length !== IBEACON_FRAME_LENGTH) || //22 !== 23 (true)
                                 (data.readInt8(FRAME_LENGTH_OFFSET) !== IBEACON_LENGTH); // 0 !== 21 (true)
if(isInvalidLength) {
    return null;
}

So it returns null in consequence.
Sorry if I split the problem, but I'm working on it.

Thank you.

from advlib-ble-manufacturers.

jeffyactive avatar jeffyactive commented on August 20, 2024

Hi @m-murillo, you have indeed found a problem with the example on the README.md: the manufacturerData variable was missing a byte, and hence the library returned null when processing, as it should. Sorry for the trouble this has led you to!

The example on the README.md has been updated, and with the updated manufacturerData you should see an output of:

{
  deviceIds: [ '00112233445566778899aabbccddeeff/0123/4567' ],
  txPower: -4,
  uri: 'https://sniffypedia.org/Organization/Apple_Inc/iBeacon/'
}

Please confirm and close the issue if that works for you. Note that you may wish to instead use advlib with advlib-ble-manufacturers as a library, as this is the more common use case. Thanks!

from advlib-ble-manufacturers.

m-murillo avatar m-murillo commented on August 20, 2024

Hello jeffyactive!

It works, thank you so much.

from advlib-ble-manufacturers.

Related Issues (1)

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.