element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
IoT on Wheels Design Challenge
  • Challenges & Projects
  • Design Challenges
  • IoT on Wheels Design Challenge
  • More
  • Cancel
IoT on Wheels Design Challenge
Blog BLOG 15 : BLE Subsystem
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: gsgill112
  • Date Created: 13 Nov 2017 12:25 PM Date Created
  • Views 950 views
  • Likes 2 likes
  • Comments 2 comments
  • ble
  • sbsr
  • stm32
  • mbed
  • sbsr_iotonwheels
  • iotonwheels
  • stm32 l4
Related
Recommended

BLOG 15 : BLE Subsystem

gsgill112
gsgill112
13 Nov 2017

Hey guys, Let dive into the BLE Sub Section. I was not able to implement much on this front but it is not very difficult to implement. Let me go through the basics first

 

What is BLE ??

BLE Stands for Bluetooth Low Energy. It is a Simple yet Powerful Technology specially designed for Low power Applications. It's Strength lies in the STATE information transmission.

 

So, You may ask STATE information ?? Well that means something like Is the Device ON or OFF, is the fan ON or OFF what is the value of the PWM Signal going to LED, etc. State is just a small piece of information not something like IMAGES or AUDIO/ VIDEO, etc.

 

That being Cleared, BLE being Point to Point Communication protocol is organised  into 2 Main Roles Client / Server OR Peripheral / Central  OR Slave / Master

These means out of two devices one will me Master and one Will be Salve. The Master will control the Slave (Ohh This sounds more like 50 Shades of Grey !!! ***. !!)

These 2 profiles Majorly are known as GAP or Generic Access Profiles for you guys with BigAss Specks image image image

(Thanks to LadyAda for this Image)image

 

Moving on, the devices we usually implement as a End user device is a BLE Peripheral / Slave / Client device. So everything now on will be based on this statement.

So, In a Client Device How To send data to other Devices ?

Well, to ease things up Bluetooth implements a Service / Attribute Structure.

Puzzeled ??

 

Don't Worry, Let Me Explain.

 

Lets say you want to order a Brand New iPhone X/TEN/10/ Whatever !!!! Online image I would prefer flipkart/ Amazon image

So you would like to go to a Website that would Sell you the Item ?? like Amazon or best buy !! this is our Seller Service 

Now Once you land up  at Amazon You would like to go to the Mobile Section who offer Mobile Sale Services !! This is the Characteristic or Attributes

Now We would like to  Go to the iPhone Section which would contain information on all iPhones !! This is the values in the Characteristic or Attributes 

All of the Above is Geeky Known as GATT or Generic Attribute Profile

 

Refer this diagram for ease of understanding

imageimage

 

Finally the Values which we will play with are in Name Value pair, i.e. UUID, VALUE.

 

This was the Super super dooper short introduction on BLE If you are interested in more I suggest gat a Pink hair Die and meet LadyAda image Here.

 

Moving to the implementation Again ST was good to provide a LIBRARY for BLE HERE with an Example Application HERE .

While this is good for understanding the Basics of How things work. It's not enough to implement a custom BLE Service.  For that I have these two links Below

1.     BLE Link for bed BLE API

2.     How to change BLE_GAP Profile Selection

3.     How to create custom GATT Services

 

Now there are some Predefined GATT Profiles Provided by Bluetooth themselves found at this link.

 

Finally , Let me show the little work I have done in BLE Part !! Its Actually nothing Great

 

Adding the Headers including GATT Profiles

#include "ble/BLE.h"
#include "LEDService.h"
#include "BatteryService.h"
#include "DeviceInformationService.h"

 

Setting the parameters like Device List LIST

const static char     DEVICE_NAME[] = "IoToWSbSr";
static const uint16_t uuid16_list[] = {LEDService::LED_SERVICE_UUID,
                                       //GattService::UUID_BATTERY_SERVICE,
                                       GattService::UUID_DEVICE_INFORMATION_SERVICE};


LEDService *ledServicePtr;

 

Setting the GATT Parameters

/* Setup Device Identification service. */
    DeviceInformationService devInfoService(ble, "ST Micro", "NUCLEO-L476RG", "XXXX", "v1.0", "v1.0", "v1.0");
 

 

You can extend the to anything you would like to.

 

As I have Not yet customised the BLE Part much This is pretty much the basics. It will be easy to implement the custom GATT profiles .

 

Thanks for Reading

Regards,

GS Gill

  • Sign in to reply
  • DAB
    DAB over 7 years ago

    Nice update.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shantimohan
    shantimohan over 7 years ago

    Hi Gurinder,

     

    You have provided a gold mine of details on BLE implementation. You have done good research and provided a good starting point for me. Now I got confidence that I can implement BLE on STM32 board.

     

    Wishing you good luck.

     

    ThanQ...

    Shantimohan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube