Skip to content

Sending wrong fields crashes the bridge #4

@jhchabran

Description

@jhchabran
 (prototype/browser) ~/code/flylab/drone.js$ git diff
diff --git a/index.js b/index.js
index 189654b..4113a7a 100644
--- a/index.js
+++ b/index.js
@@ -34,7 +34,7 @@ Drone.prototype.messageHandler = function(event) {
   if (uavObject.Name === 'FlightTelemetryStats') {
                this.debug('got FlightTelemetryStats.Status = ' + uavObject.Data.status);

-    if (uavObject.Data.Status === 'Disconnected') { // HINT: Create an UavObject class ?
+    if (uavObject.Data.status === 'Disconnected') { // HINT: Create an UavObject class ?

     }
   }
@@ -60,12 +60,12 @@ Drone.prototype.setupTelemetry = function() {
   this.debug("Handshaking Telemetry stats");

   this.sendMessage('GCSTelemetryStats', 'object', {
-                       Status: 'HandshakeReq',
-                       TxDataRate: 0,
-                       RxDataRate: 0,
-                       TxFailures: 0,
-                       RxFailures: 0,
-                       TxRetries: 0
+                       status: 'HandshakeReq',
+                       txDataRate: 0,
+                       rxDataRate: 0,
+                       txFailures: 0,
+                       rxFailures: 0,
+                       txRetries: 0
   });

Will segfault with https://gist.github.com/jhchabran/05848498a8c9f6109488

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions