Code Monkey home page Code Monkey logo

smart--notifier's Introduction

Notifier App

The app acts a Notifier that keeps the user updated with the relevant information over serial terminal as well as nRF Connect App over BLE. The data that's displayed depends on what the user has subscribed to through the supported commands.

Supported Commands

User can interface with the app over UART and nRF Connect App, which acts as a central and talks to the peripheral (nRF52 DK) running the FW.

Following are the currently supported commands:

Commands Function
tempOff unsubscribes the temperature sensor from the Notification class: user would no longer see any updated temperature values
tempOn subscribes the temperature sensor to the Notification: user would receive notifications containing temperature values in C°

Observer Pattern

The sensor class forms a concrete Subject that stores a reference to the Observer which in our case is the Notification class.

As soon as there's a sensor data ready to be pushed to a notification list, it invokes a corresponding Subject::notify() that in turn calls a correspondg update() call of Notification classes that takes care of updating the notification list with a desired data.

This pattern is used for scalability: for X amount of sensors to be used (in the future), each of which could be attached by the Notification class. And there's always flexibility to unsubscribe any sensor from the Notification class.

Screen Shot 2022-01-18 at 4 23 51 PM

User Interfacing

  1. UART terminal with supported user commands alongside the view from Logic Analyzer
Screenshot 2023-11-13 at 8 33 34 PM

Following is a zoomed-in view of a sensor reading Screen Shot 2022-01-30 at 5 06 49 PM

  1. nRF Connect App The value attribute contains 0x13 represents the temperature value sent from the peripheral/GATT server. The (blue) highlighted button on the far-right indicates notification is enabled by the central/GATT client.

    IMG_6219

Todo

  1. The output over serial terminal seems to be lagging particularly after the scheduler kicks in. Need to investigate.
  2. Finish the Logger class
  3. Do something meaningful with the notification list -- thoughts: upload data to a server that displays the data graphically
  4. Look into why more than 1 byte is shown in the value in BLE service in nRF Connect app

smart--notifier's People

Contributors

huzzziiii avatar

Stargazers

 avatar

Watchers

 avatar

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.