@@ -522,6 +522,8 @@ board_utils = function (session, rest) {
522
522
var hash_b_pw = credentials . hash_pw ;
523
523
var b_pub_key = credentials . pub_key ;
524
524
525
+ console . log ( credentials ) ;
526
+
525
527
db . regBoard ( board_id , board_label , latitude , longitude , altitude , net_enabled , sensorslist , layout_id , description ,
526
528
extra , project_id , user_id , mobile , position_refr_time , notify , notify_rate , notify_retry , b_pub_key , hash_b_pw ,
527
529
@@ -530,7 +532,10 @@ board_utils = function (session, rest) {
530
532
if ( db_result . result === "SUCCESS" ) {
531
533
532
534
logger . info ( "[SYSTEM] --> Registration of board '" + board_id + "' successfully completed!" ) ;
533
- db_result . password = b_pw ;
535
+ if ( b_pw == "" || b_pw == undefined ) {
536
+ db_result . password = credentials . gen_pw ;
537
+ } else
538
+ db_result . password = b_pw ;
534
539
535
540
res . status ( 200 ) . send ( db_result ) ;
536
541
@@ -792,7 +797,9 @@ board_utils = function (session, rest) {
792
797
var localISOTime = ( new Date ( Date . now ( ) - tzoffset ) ) . toISOString ( ) ;
793
798
position . timestamp = localISOTime ;
794
799
795
- session . call ( 's4t.' + board + '.board.setBoardPosition' , [ position ] ) . then (
800
+ console . log ( "position @ " + position . timestamp ) ;
801
+
802
+ session_wamp . call ( 's4t.' + board + '.board.setBoardPosition' , [ position ] ) . then (
796
803
797
804
function ( conf_result ) {
798
805
response . message = db_result . message + " - " + conf_result ;
@@ -2319,7 +2326,7 @@ var addBoardPosition = function (board, latitude, longitude, altitude, res){
2319
2326
2320
2327
logger . debug ( "--> Board " + available . message . label + " (" + board + ") exists!" ) ;
2321
2328
2322
- if ( available . message . mobile == 1 ) {
2329
+ // if (available.message.mobile == 1){
2323
2330
2324
2331
db . addBoardPosition ( board , latitude , longitude , altitude , function ( data ) {
2325
2332
@@ -2341,7 +2348,7 @@ var addBoardPosition = function (board, latitude, longitude, altitude, res){
2341
2348
2342
2349
2343
2350
} ) ;
2344
-
2351
+ /*
2345
2352
}else{
2346
2353
2347
2354
response.result = "WARNING";
@@ -2350,6 +2357,7 @@ var addBoardPosition = function (board, latitude, longitude, altitude, res){
2350
2357
res.status(200).send(response);
2351
2358
2352
2359
}
2360
+ */
2353
2361
2354
2362
2355
2363
0 commit comments