SlideShare uma empresa Scribd logo
1 de 34
Aspirus
About Me
• iOS developer
• Runs Azukisoft Pte Ltd
• Author of
http://www.amazon.com/Objecti
ve-C-Memory-Management-
Essentials-Gibson-
ebook/dp/B00V8BMX7I/
What is the Aspirus Standing Desk?
• Standing Desk
• But Smarter
• https://www.indiegogo.com/p
rojects/aspirus-world-s-first-
smart-standing-workstation#/
Functionality
• 8-in-1 SMART WORKSTATION
with one-touch elevation,
smart app, sit-stand reminder,
tracking and more
• https://www.youtube.com/watch?v
=H7b8GMvqi_E
Technology Stack
• Objective-C
• Cocoapods
• AFNetworking
• Core Bluetooth
Core Bluetooth
• Desk uses a TI (Texas
Instrument Controller)
• With a BT sensor
• And registers
iPhone
•What type of
communication protocol
to use?
•JSON? XML? SOAP?
Protocol
• We settled on Modbus after discussion with
the hardware engineer
• WTF is Modbus?
Modbus
• https://en.wikipedia.org/wiki/Modbus
• Modbus is a serial communications protocol
originally published by Modicon (now Schneider
Electric) in 1979 for use with its programmable
logic controllers
• Simple and robust, it has since become a de facto
standard communication protocol, and it is now a
commonly available means of connecting
industrial electronic devices
Modbus
• Royalty free too
• Which means someone wrote a objective-c
library
• Which we can use?
Modbus
WRONG!!!
Modbus
Modbus
• https://github.com/iUtvikler/ObjectiveLibMod
bus (Only support TCP)
• http://www.modbusapps.com/mbk.php
(Supports TCP only again. Damned!!)
• http://libmodbus.org/documentation/ (Again,
it supports TCP only. Double damned!!!!)
Modbus
• So we had no choice, but to write our own
implementation
• Look for online documentation
• Start hacking away
• http://www.modbustools.com/modbus.html
Modbus
• 30 0300 2500 01 91E0
Modbus
• 30 0300 2500 01 91E0
• 30 – Random Tag
• 0300 – Address of register
• 2500 – Function to use
• 01 – Data to send
• 91E0 – CRC check
Bluetooth
• CRC calculated using some arcane formula
involving bit shifting, blood of your first born
and some magical incantations
• http://www.ccontrolsys.com/w/How_to_Com
pute_the_Modbus_RTU_Message_CRC
Bluetooth
• After calculation, how do we send it to the
controller on the desk?
• 1st, we scan for a peripherals and then get an
array of peripherals
• retrieveConnectedPeripheralsWithServices
returns a NSArray of peripherals
Bluetooth
• Then we do a connection
• - (void)connectPeripheral:(CBPeripheral
*)peripheral options:(NSDictionary<NSString
*, id> *)options
• Great. Now the easy part is done
Modbus
• So how we do send the data
over?
• Binary?
• Text?
• ???
Modbus
• Only way is using byte array
• So we convert our NSString
• Contain Hex values
• To a byte array
Modbus
• - (NSData *) convert_to_byte_array:(NSString *) str {
• const char *chars = [str UTF8String];
• int i = 0; NSUInteger len = str.length;
•
• NSMutableData *data = [NSMutableData dataWithCapacity:len / 2];
• char byteChars[3] = {'0','0','0'};
• unsigned long wholeByte;
•
• while (i < len) {
• byteChars[0] = chars[i++];
• byteChars[1] = chars[i++];
• wholeByte = strtoul(byteChars, NULL, 16);
• [data appendBytes:&wholeByte length:1];
• }
• return data;
• }
Modbus
• Then get the write
characteristic of the BT device
• And send the data to it
Modbus
• CBCharacteristic *write_characteristic =
self.discoveredSevice.characteristics[1];
• [self.selectPeripheral writeValue:data
forCharacteristic:write_characteristic
type:
CBCharacteristicWriteWithResponse];
Modbus
• Then in the callback function.
We await the response from
the device
• - (void)peripheral:(CBPeripheral *)peripheral
didUpdateValueForCharacteristic:(CBCharacte
ristic *)characteristic error:(NSError *)error
Modbus
• But wait, there’s more!!!
• Remember that random tag?
• 30030025000191E0
• 30 – Random Tag
• 0300 – Address of register
• 2500 – Function to use
• 01 – Data to send
• 91E0 – CRC check
Modbus
• In our
didUpdateValueForCharacteri
stic function, we have to keep
writing the same data and
check the random tag matches
what was sent to the device
Modbus
1. Write random tag and value to
characteristic
2. Await for response
3. Get the random tag from response
4. If tag does not match what was sent
in step #1
5. Rinse and repeat step #1 until it does
Modbus
1. So once all these are done
2. We reused the code so that we
are able to get various sensor
data from the device
3. Desk up/down position, adjust
desk light, detection of user
presense etc
Aspirus
Aspirus
Aspirus

Mais conteúdo relacionado

Semelhante a Modbus using Coreblue Bluetooth for iOS to connect to a hardware sensor

DevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesDevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesAndreas Katzig
 
From a student to an apache committer practice of apache io tdb
From a student to an apache committer  practice of apache io tdbFrom a student to an apache committer  practice of apache io tdb
From a student to an apache committer practice of apache io tdbjixuan1989
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redisErhwen Kuo
 
¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!Antonio Robres Turon
 
Toward Hybrid Cloud Serverless Transparency with Lithops Framework
Toward Hybrid Cloud Serverless Transparency with Lithops FrameworkToward Hybrid Cloud Serverless Transparency with Lithops Framework
Toward Hybrid Cloud Serverless Transparency with Lithops FrameworkLibbySchulze
 
Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Ike Ellis
 
Automate using Python
Automate using PythonAutomate using Python
Automate using PythonYogeshIngale9
 
Iot meets Serverless
Iot meets ServerlessIot meets Serverless
Iot meets ServerlessNarendran R
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumTechday7
 
What's new in Xamarin.iOS, by Miguel de Icaza
What's new in Xamarin.iOS, by Miguel de IcazaWhat's new in Xamarin.iOS, by Miguel de Icaza
What's new in Xamarin.iOS, by Miguel de IcazaXamarin
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titaniumNaga Harish M
 
Cs1123 11 pointers
Cs1123 11 pointersCs1123 11 pointers
Cs1123 11 pointersTAlha MAlik
 
Null mumbai-iot-workshop
Null mumbai-iot-workshopNull mumbai-iot-workshop
Null mumbai-iot-workshopNitesh Malviya
 
Microsoft IoT & Data OpenHack Zürich
Microsoft IoT & Data OpenHack ZürichMicrosoft IoT & Data OpenHack Zürich
Microsoft IoT & Data OpenHack ZürichSascha Corti
 
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual MachineDino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual MachineESUG
 
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform ExploitationOne Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform ExploitationQuinn Wilton
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
 
Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Sperasoft
 
Code and memory optimization tricks
Code and memory optimization tricksCode and memory optimization tricks
Code and memory optimization tricksDevGAMM Conference
 

Semelhante a Modbus using Coreblue Bluetooth for iOS to connect to a hardware sensor (20)

DevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesDevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile Games
 
From a student to an apache committer practice of apache io tdb
From a student to an apache committer  practice of apache io tdbFrom a student to an apache committer  practice of apache io tdb
From a student to an apache committer practice of apache io tdb
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redis
 
¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!
 
Toward Hybrid Cloud Serverless Transparency with Lithops Framework
Toward Hybrid Cloud Serverless Transparency with Lithops FrameworkToward Hybrid Cloud Serverless Transparency with Lithops Framework
Toward Hybrid Cloud Serverless Transparency with Lithops Framework
 
Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017Dive Into Azure Data Lake - PASS 2017
Dive Into Azure Data Lake - PASS 2017
 
Automate using Python
Automate using PythonAutomate using Python
Automate using Python
 
Iot meets Serverless
Iot meets ServerlessIot meets Serverless
Iot meets Serverless
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 
What's new in Xamarin.iOS, by Miguel de Icaza
What's new in Xamarin.iOS, by Miguel de IcazaWhat's new in Xamarin.iOS, by Miguel de Icaza
What's new in Xamarin.iOS, by Miguel de Icaza
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
 
Cs1123 11 pointers
Cs1123 11 pointersCs1123 11 pointers
Cs1123 11 pointers
 
Null mumbai-iot-workshop
Null mumbai-iot-workshopNull mumbai-iot-workshop
Null mumbai-iot-workshop
 
Microsoft IoT & Data OpenHack Zürich
Microsoft IoT & Data OpenHack ZürichMicrosoft IoT & Data OpenHack Zürich
Microsoft IoT & Data OpenHack Zürich
 
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual MachineDino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
Dino2 - the Amazing Evolution of the VA Smalltalk Virtual Machine
 
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform ExploitationOne Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform Exploitation
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks Code and Memory Optimisation Tricks
Code and Memory Optimisation Tricks
 
Code and memory optimization tricks
Code and memory optimization tricksCode and memory optimization tricks
Code and memory optimization tricks
 

Mais de Azukisoft Pte Ltd

Mais de Azukisoft Pte Ltd (8)

From Idea to App Store
From Idea to App StoreFrom Idea to App Store
From Idea to App Store
 
Ohoh
OhohOhoh
Ohoh
 
Intro to Laravel
Intro to LaravelIntro to Laravel
Intro to Laravel
 
Storyboard prototyping
Storyboard prototypingStoryboard prototyping
Storyboard prototyping
 
The good, bad and ugly of Digital Ocean vs AWS
The good, bad and ugly of Digital Ocean vs AWSThe good, bad and ugly of Digital Ocean vs AWS
The good, bad and ugly of Digital Ocean vs AWS
 
Presentation
PresentationPresentation
Presentation
 
Cocos2d for beginners
Cocos2d for beginnersCocos2d for beginners
Cocos2d for beginners
 
Mobile Marketing Dec2009
Mobile Marketing Dec2009Mobile Marketing Dec2009
Mobile Marketing Dec2009
 

Último

9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 

Último (8)

9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 

Modbus using Coreblue Bluetooth for iOS to connect to a hardware sensor

  • 2. About Me • iOS developer • Runs Azukisoft Pte Ltd • Author of http://www.amazon.com/Objecti ve-C-Memory-Management- Essentials-Gibson- ebook/dp/B00V8BMX7I/
  • 3. What is the Aspirus Standing Desk? • Standing Desk • But Smarter • https://www.indiegogo.com/p rojects/aspirus-world-s-first- smart-standing-workstation#/
  • 4.
  • 5. Functionality • 8-in-1 SMART WORKSTATION with one-touch elevation, smart app, sit-stand reminder, tracking and more
  • 7. Technology Stack • Objective-C • Cocoapods • AFNetworking • Core Bluetooth
  • 8. Core Bluetooth • Desk uses a TI (Texas Instrument Controller) • With a BT sensor • And registers
  • 9. iPhone •What type of communication protocol to use? •JSON? XML? SOAP?
  • 10. Protocol • We settled on Modbus after discussion with the hardware engineer • WTF is Modbus?
  • 11. Modbus • https://en.wikipedia.org/wiki/Modbus • Modbus is a serial communications protocol originally published by Modicon (now Schneider Electric) in 1979 for use with its programmable logic controllers • Simple and robust, it has since become a de facto standard communication protocol, and it is now a commonly available means of connecting industrial electronic devices
  • 12. Modbus • Royalty free too • Which means someone wrote a objective-c library • Which we can use?
  • 15. Modbus • https://github.com/iUtvikler/ObjectiveLibMod bus (Only support TCP) • http://www.modbusapps.com/mbk.php (Supports TCP only again. Damned!!) • http://libmodbus.org/documentation/ (Again, it supports TCP only. Double damned!!!!)
  • 16. Modbus • So we had no choice, but to write our own implementation • Look for online documentation • Start hacking away • http://www.modbustools.com/modbus.html
  • 17. Modbus • 30 0300 2500 01 91E0
  • 18. Modbus • 30 0300 2500 01 91E0 • 30 – Random Tag • 0300 – Address of register • 2500 – Function to use • 01 – Data to send • 91E0 – CRC check
  • 19. Bluetooth • CRC calculated using some arcane formula involving bit shifting, blood of your first born and some magical incantations • http://www.ccontrolsys.com/w/How_to_Com pute_the_Modbus_RTU_Message_CRC
  • 20. Bluetooth • After calculation, how do we send it to the controller on the desk? • 1st, we scan for a peripherals and then get an array of peripherals • retrieveConnectedPeripheralsWithServices returns a NSArray of peripherals
  • 21. Bluetooth • Then we do a connection • - (void)connectPeripheral:(CBPeripheral *)peripheral options:(NSDictionary<NSString *, id> *)options • Great. Now the easy part is done
  • 22. Modbus • So how we do send the data over? • Binary? • Text? • ???
  • 23. Modbus • Only way is using byte array • So we convert our NSString • Contain Hex values • To a byte array
  • 24. Modbus • - (NSData *) convert_to_byte_array:(NSString *) str { • const char *chars = [str UTF8String]; • int i = 0; NSUInteger len = str.length; • • NSMutableData *data = [NSMutableData dataWithCapacity:len / 2]; • char byteChars[3] = {'0','0','0'}; • unsigned long wholeByte; • • while (i < len) { • byteChars[0] = chars[i++]; • byteChars[1] = chars[i++]; • wholeByte = strtoul(byteChars, NULL, 16); • [data appendBytes:&wholeByte length:1]; • } • return data; • }
  • 25. Modbus • Then get the write characteristic of the BT device • And send the data to it
  • 26. Modbus • CBCharacteristic *write_characteristic = self.discoveredSevice.characteristics[1]; • [self.selectPeripheral writeValue:data forCharacteristic:write_characteristic type: CBCharacteristicWriteWithResponse];
  • 27. Modbus • Then in the callback function. We await the response from the device • - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacte ristic *)characteristic error:(NSError *)error
  • 28. Modbus • But wait, there’s more!!! • Remember that random tag? • 30030025000191E0 • 30 – Random Tag • 0300 – Address of register • 2500 – Function to use • 01 – Data to send • 91E0 – CRC check
  • 29. Modbus • In our didUpdateValueForCharacteri stic function, we have to keep writing the same data and check the random tag matches what was sent to the device
  • 30. Modbus 1. Write random tag and value to characteristic 2. Await for response 3. Get the random tag from response 4. If tag does not match what was sent in step #1 5. Rinse and repeat step #1 until it does
  • 31. Modbus 1. So once all these are done 2. We reused the code so that we are able to get various sensor data from the device 3. Desk up/down position, adjust desk light, detection of user presense etc