Categories

[Little Brosers] Being Heard

Hello,

If you’ve read my last post, you’re probably expecting me to have finished the Bluetooth discovery part of the mobile app. However, sometimes in order to go forward, we have to take a different route, which is why today, we are going to delve further into BLE advertising. But before we do that, let’s take a look at the way we imagined the hierarchy of Little Brosers:

Hierarchy

 

  • Company A
  • Company C
    • Network A
    • Network N
      • Drop 1
      • Drop 2
      • Drop 3

Let’s explain more what each level represents:

  • Company represents the company or the entity that is able to create and manage drop networks. We’re still not sure if we want to add this level or not.
  • Network represents a network of drops within a company.
  • Drop represents the individual drops inside a network.

BLE Advertising

 

Now that that’s out of the way, we can take a look at the BLE advertising packet, more specifically the connectable undirected advertising. It’s made out of a normal BLE packet, where the payload contains 2 sections, AdvA, a 6-byte device address, and AdvData, the actual data being advertised, which can take from 0 to 31 bytes. Our focus is on the AdvData section, which in itself can contain multiple advertising data structures that can offer different types of info. We however, will target a specific type called “Manufacturer Specific Data”. 

Let’s not forget that when the drop is not connected to a device, it will be transmitting this advertising packet at a constant interval, and since this is an essential part of the process, it would be a good idea to use it to announce as much information as possible so that the smartphone can tell from the advertising alone if it needs to connect to this drop or not.

Back to manufacturer specific data, the format is the following:

  • Company ID (2 bytes)
  • Manufacturer data

The company ID is an assigned number by the Bluetooth SIG. This will probably force us to use a specific value that we have no control over in order to stay compliant with the specification. However, the manufacturer data part is where will put the info we need.

  • Little Brosers ID (4 bytes)
  • Company ID (2 bytes)
  • Network ID (2 bytes)
  • Drop ID (2 bytes)
  • Additional info to prevent unneeded connections

Company, network and drop ID are IDs for the elements within the hierarchy detailed above. Little Brosers ID is a magic number that will define to identify the drops as part of the Little Brosers project. The scan results filter of the mobile app will act on these fields to determine if the detected BLE advertisements are of interest or not.

Our Own UUIDs

 

In Bluetooth, services are identified by a Universally Unique IDentifier (UUID). Custom UUIDs which are 128-bit long are used for custom services not registered with the Bluetooth SIG. So in order to follow the same method used for the registered services, we decided to give a 16-bit ID to our services, while changing of course the base UUID so that we do not use the default Bluetooth assigned numbers. Our custom base UUID will contain the following elements:

  • Little Brosers ID
  • Company ID
  • Network ID

I’m not sure if we will include the drop ID as well. At this point it doesn’t seem to be useful here.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>