OLLYDOTDEV / Project-Birdseye-DTX-2020

The initial plan is to create a device that is made for the sole purpose of a Preemptive Security system for People who work with Confidential/Private Information and need to work on potentially more public places where one cant Guarantee fully secure/discrete room. My Approach to solving this is with a wireless computing node That Takes Sensor data from a variety of senses. Then the Data from the Senses is taken then and processed to determine whether there is a security breach if so then it will Relay that info over to the Raspberry Pi W that then Emulates an HID (Human interface device) Using the P4wnP1_aloa made by mame82 to Execute a custom user-defined action that will be set via Apache server hosted of the Raspberry Pi W Communicating From a web interface back to the purchase server utilizing Ajax
GNU General Public License v3.0
3 stars 1 forks source link

Wireless data processing #29

Closed OLLYDOTDEV closed 3 years ago

OLLYDOTDEV commented 3 years ago

As a software engineer There needs to be some backend to take the data from #17 #30 and work out what to do with the given data packet. this will lead on to the mode selection found in #23 thus a conditional switching statement will be implemented to complete this story

OLLYDOTDEV commented 3 years ago

pseudo-code for the sending function

there are there data packet types that I might send Mode | alert | status

Send role

function Mode(Mode){

check role is a valued role

packet header = mode 
data = role

call send packet function.
transmit(header,data) 
}

send alert status | only will be called if there is a status change

function sendalert(){

get alert status 

packet header = alert 
data = status of alert 
}

status ||

function getstatus(){

packet header = status 
data = power up

}
OLLYDOTDEV commented 3 years ago

pseudo-code for the receiving

reader header of packet and trigger a switch state of one of these options

Alert

Mode packet

switch(){

mode1 (IR) call function to configure ROMS to mode 1 mode2 (PIR) call function to configure ROMS to mode 2 mode3 (ALL) call function to configure ROMS to mode 3 } }


what each mode will do will be done in the next sprint and found in #23 

status
- [x] Done

when packet = status {

nothing as it is just to test if there is a connecting between the radios

}



or It might be other in that case it will just output it to the Serial monitor then do nothing with it 
OLLYDOTDEV commented 3 years ago

https://github.com/OLLYDOTDEV/Project-Birdseye-DTX-2020/commit/08cfda5985f5be98dae3ead022404e1707a74b1c & https://github.com/OLLYDOTDEV/Project-Birdseye-DTX-2020/commit/a8e03e7c9562dfba7869de588345b6778b17c32f contains the implementation of Wireless data processing that is able to account for a range of border cases via using a wide range of different custom functions.

while some of these are the same functions as used in #30 they will have been modified to ensure reliability and validity.

such as RECEIVE() function updated to support the new data structure of the packets this structure houses the Header and Data that is processed using non-trivial string manipulation to allow it to be transmitted. as well as added a case switch.

the switch used in the RECEIVE() function within the RPI.Cpp file is using a whitelist system to check for incoming packets that have matching packet header properties of MODE,STATUS,ALERT if it doesn't match any of them then the packet is disregarded.

whereas the RECEIVE() function for ROMS.ino is only looking for MODE,STATUS packet Header as it will be the sending out a packet with an ALERT header therefor does not need to look for it, this helps with ensuring logical response by simplifying the potential outcomes

OLLYDOTDEV commented 3 years ago

another function used/ changed is the TRANSMIT(string header, string data ) this function is able to take two parameters. The header is used to see the header of the packet. this header is used to determine what should be done with the contents inside the packet, eg what mode ROMS should be in or just used to test the connection of the radios. these parameters are phased into char arrays before being formatted into a packet and then transmitted, for more on this process see here

OLLYDOTDEV commented 3 years ago

a function added uniquely to RPI.cpp is void ModeInterface(void) this function is used to set up the packet that contains what mode ROMS should be in. as for now it is just set to a status value as that in will be added in #23

OLLYDOTDEV commented 3 years ago

both will have in time the getstatus() function and all that does I check if there is a connection between NRF24 radios.

OLLYDOTDEV commented 3 years ago

lastly ROMS.ino a function added to it is SecurityMode() this function allows the data from a MODE packet to be deciphered into instructions. that can be converted into what mode ROMS should be running in.

OLLYDOTDEV commented 3 years ago

for next stage of using this data after it has been processed see #23