+ int contradictions = 0;
+ uint32_t session_id = 0;
+ submesh_t *s = NULL;
+
+ if(sscanf(request, "%*d %*x "MAX_STRING" %d "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %d "MAX_STRING" %*x %d %d %x",
+ from_name, &from_devclass, from_submesh_name, to_name, to_address, to_port, &to_devclass, to_submesh_name,
+ &weight, &contradictions, &session_id) < 9) {
+ logger(mesh, MESHLINK_ERROR, "Got bad %s from %s", "ADD_EDGE", c->name);
+ return false;
+ }
+
+ // Check if devclasses are valid
+
+ if(from_devclass < 0 || from_devclass >= DEV_CLASS_COUNT) {
+ logger(mesh, MESHLINK_ERROR, "Got bad %s from %s: %s", "ADD_EDGE", c->name, "from devclass invalid");
+ return false;
+ }