You are reading a single comment by @valap95 and its replies. Click here to read the full conversation.
  • hi @Gordon,
    I added this typescript code to banglerun:

    import { AppState} from './state';
    
    declare var NRF: any;
    
    function startStreaming(state:AppState):void{
     
        SetServices(state);
    }
    
    
    //Setto i servizi per preparare la connessione 
    function SetServices(state:AppState){
      NRF.setServices({
        // activity services
        'f8b20001-89ad-4220-8c9f-d81756009f0c': {
            'f8b20002-89ad-4220-8c9f-d81756009f0c': {
            descriptio: 'duration',
            notify: true,
            readable: true,
            value: []
          },
          'f8b20003-89ad-4220-8c9f-d81756009f0c':{­
              description: 'distance',
              notify:'true',
              readable: 'true',
              value: [0]
          },
          'f8b20004-89ad-4220-8c9f-d81756009f0c':{­
            description: 'speed',
            notify:'true',
            readable: 'true',
            value: [0]
          },
          'f8b20005-89ad-4220-8c9f-d81756009f0c':{­
            description: 'steps',
            notify:'true',
            readable: 'true',
            value: [0]
          },
          'f8b20006-89ad-4220-8c9f-d81756009f0c':{­
            description: 'cadence',
            notify:'true',
            readable: 'true',
            value: [0]
          },
    
    
        },
        //HR services
        
        'f8b20007-89ad-4220-8c9f-d81756009f0c': {
            'f8b20008-89ad-4220-8c9f-d81756009f0c': {
            description:'HR',
            readable: true,
            notify: true,
            value : [0],
        }
      }       
    });
    UpdateServices(state);
    }
    
    
    
        function UpdateServices(state: AppState): void {
          NRF.updateServices({
            // activity services
            'f8b20001-89ad-4220-8c9f-d81756009f0c': {
                'f8b20002-89ad-4220-8c9f-d81756009f0c': {
                descriptio: 'duration',
                notify: true,
                readable: true,
                value: [state.duration]
              },
              'f8b20003-89ad-4220-8c9f-d81756009f0c':{­
                  description: 'distance',
                  notify:'true',
                  readable: 'true',
                  value: [state.distance]
              },
              'f8b20004-89ad-4220-8c9f-d81756009f0c':{­
                description: 'speed',
                notify:'true',
                readable: 'true',
                value: [state.speed]
              },
              'f8b20005-89ad-4220-8c9f-d81756009f0c':{­
                description: 'steps',
                notify:'true',
                readable: 'true',
                value: [state.steps]
              },
              'f8b20006-89ad-4220-8c9f-d81756009f0c':{­
                description: 'cadence',
                notify:'true',
                readable: 'true',
                value: [state.cadence]
              },
        
        
            },
            //HR services
            
            'f8b20007-89ad-4220-8c9f-d81756009f0c': {
                'f8b20008-89ad-4220-8c9f-d81756009f0c': {
                description:'HR',
                readable: true,
                notify: true,
                value : [state.hr],
            }  
          }     
        });
     }
    
    

    this code, when the app starts, set services, and when you press start button should start to update value. But when I run the code i obtain this error:


    1 Attachment

    • fileErr.PNG
About

Avatar for valap95 @valap95 started