Skip to content

Commit

Permalink
Updated sequence diagrams again
Browse files Browse the repository at this point in the history
  • Loading branch information
Addy Kimball committed Jun 25, 2015
1 parent 67a4bdb commit 594e2e3
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 18 deletions.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
Title Standard Admin Scenario
Participant RTC
Participant Relay
Participant Equipment
Participant Phone
Participant User
Phone -> Parse: Login, is User Admin?
Parse -> Phone: Is Admin
Phone -> Phone: UI Setting: Admin
Phone -> Parse: Change parse settings (users, equipment name, etc.)
Equipment->Phone: Advertising Packet with Equipment ID & Status, etc.
Phone -> Phone: update UI
User -> Phone: Select GLD
User -> Phone: Activate/Configure
Phone -> Equipment: BLE Connect
Phone -> Equipment: BLE Connect (with timeout)
Equipment -> Phone: BLE Connection Successful
Phone -> Equipment: DateTime
Equipment -> RTC: Update DateTime
Phone -> Equipment: MD5 Hash to Authorize
Equipment -> Equipment: Generate MD5 and Compare
Phone -> Equipment: See authorization sequence
Equipment -> Phone: Authorized (Admin)
Phone -> Equipment: Configure/Activate
Equipment -> Relay: Power On/Off
Phone -> Equipment: Configure/Activate (Device ID, etc.)
Phone -> Equipment: BLE Disconnect
Equipment -> Phone: Advertising Packet with Equipment ID & Status, etc.
Phone -> Parse: Update usage log
21 changes: 21 additions & 0 deletions Documentation/Sequence Diagrams/authorization sequence.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Title Authorization
Participant RTC
Equipment->Phone: Advertising Packet with Equipment ID & Status
Participant User
Phone -> Parse: isEquipmentAuthorized?
Parse -> Phone: isAuthorized
Phone -> Phone: update UI
User -> Phone: Enable Equipment/Other feature
Phone -> Equipment: BLE Connect
Equipment -> Phone: BLE Connection Successful
Phone -> Equipment: DateTime
Equipment -> RTC: Update DateTime on RTC
RTC -> Equipment: Append UUID with DateTime = MD5 Input
Equipment -> Equipment: Make MD5 Hash
Phone -> Phone: Make MD5 Hash
Phone -> Equipment: Send MD5 Hash
Equipment -> Equipment: Compare MD5 Hashes made with same UUID and same general time
Equipment -> Equipment: Match? Yes = Authorized, No = Force disconnect
Equipment -> Phone: Authorized
Phone -> Equipment: Send plaintext command
Equipment -> Equipment: Execute command, disconnect
Binary file added Documentation/Sequence Diagrams/authorization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
Title Standard User Scenario
Participant RTC
Participant Relay
Participant Equipment
Participant Phone
Participant User
Phone -> Parse: Login, is User Admin?
Parse -> Phone: No, is not Admin
Phone -> Phone: UI Setting: User
Phone -> Parse: Configure user settings (account settings, etc.)
Equipment->Phone: Advertising Packet with Equipment ID & Status, etc.
Phone -> Parse: isEquipmentAuthorized?
Parse -> Phone: isAuthorized
Phone -> Phone: update UI
User -> Phone: Select/Activate GLD
Phone -> Equipment: BLE Connect
Equipment -> Phone: BLE Connection Successful
Phone -> Equipment: DateTime
Equipment -> RTC: Update DateTime
Phone -> Equipment: MD5 Hash to Authorize
Equipment -> Equipment: Generate MD5 and Compare
Equipment -> Phone: Authorized
Phone -> Equipment: See authorization sequence
Phone -> Equipment: On/Off Command
Equipment -> Relay: Power On/Off
Phone -> Equipment: BLE Disconnect
Phone -> Equipment: BLE Disconnect or receive other command
Equipment -> Phone: Advertising Packet with Equipment ID & Status, etc.
Phone -> Parse: Update usage log
Binary file added Documentation/Sequence Diagrams/user sequence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Firmware/initialAdvertisingTest/initialAdvertisingTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void updateManufactureData()

bool getAuthFromMD5Hash(char hashReceived[])
{
char testString[]="6A2041DB-5942-44D7-844C-8C17D79261072015-06-14-10-03";
char testString[]="6A2041DB-5942-44D7-844C-8C17D7926107";

unsigned char* hash=MD5::make_hash(testString);
char *md5str = MD5::make_digest(hash, 10);
Expand Down
2 changes: 1 addition & 1 deletion GetDibs/BLEDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class BLEDevice : NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
}
func send(command : String, toPeripheral : BLEPeripheral)
{
var actualCommand = "\(command)\(kMD5HashSalt)\(timeAsString())"
var actualCommand = kMD5HashSalt
var md5Hash = actualCommand.MD5()
println("sending: \(md5Hash)");
self.commandToSend = md5Hash.dataUsingEncoding(NSUTF8StringEncoding)
Expand Down

0 comments on commit 594e2e3

Please sign in to comment.