@@ -456,7 +456,7 @@ func (i *Integration) dasModem(ctx context.Context, vars map[string]string, devE
456
456
457
457
loRaCloudAPIDuration ("das_v1_uplink_send" ).Observe (float64 (time .Since (start )) / float64 (time .Second ))
458
458
459
- err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl )
459
+ err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl , common . LocationSource_UNKNOWN )
460
460
if err != nil {
461
461
return errors .Wrap (err , "handle das response error" )
462
462
}
@@ -507,7 +507,7 @@ func (i *Integration) dasGNSS(ctx context.Context, vars map[string]string, devEU
507
507
508
508
loRaCloudAPIDuration ("das_v1_uplink_send" ).Observe (float64 (time .Since (start )) / float64 (time .Second ))
509
509
510
- err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl )
510
+ err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl , common . LocationSource_GEO_RESOLVER_GNSS )
511
511
if err != nil {
512
512
return errors .Wrap (err , "handle das response error" )
513
513
}
@@ -538,7 +538,7 @@ func (i *Integration) dasUplinkMetaData(ctx context.Context, vars map[string]str
538
538
return errors .Wrap (err , "das error" )
539
539
}
540
540
541
- err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl )
541
+ err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl , common . LocationSource_UNKNOWN )
542
542
if err != nil {
543
543
return errors .Wrap (err , "handle das response error" )
544
544
}
@@ -548,7 +548,7 @@ func (i *Integration) dasUplinkMetaData(ctx context.Context, vars map[string]str
548
548
return nil
549
549
}
550
550
551
- func (i * Integration ) handleDASResponse (ctx context.Context , vars map [string ]string , devEUI lorawan.EUI64 , dasResp das.UplinkResponse , ii models.Integration , pl integration.UplinkEvent ) error {
551
+ func (i * Integration ) handleDASResponse (ctx context.Context , vars map [string ]string , devEUI lorawan.EUI64 , dasResp das.UplinkResponse , ii models.Integration , pl integration.UplinkEvent , ls common. LocationSource ) error {
552
552
devResp , ok := dasResp .Result [helpers .EUI64 (devEUI )]
553
553
if ! ok {
554
554
return errors .New ("no response for deveui" )
@@ -614,7 +614,7 @@ func (i *Integration) handleDASResponse(ctx context.Context, vars map[string]str
614
614
Latitude : ps .LLH [0 ],
615
615
Longitude : ps .LLH [1 ],
616
616
Altitude : ps .LLH [2 ],
617
- Source : common . LocationSource_GEO_RESOLVER_GNSS ,
617
+ Source : ls ,
618
618
Accuracy : uint32 (ps .Accuracy ),
619
619
},
620
620
}
@@ -684,15 +684,15 @@ func (i *Integration) streamGeolocWorkaround(ctx context.Context, vars map[strin
684
684
return errors .Wrap (err , "das error" )
685
685
}
686
686
687
- err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl )
687
+ err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl , common . LocationSource_GEO_RESOLVER_GNSS )
688
688
if err != nil {
689
689
return errors .Wrap (err , "handle das response error" )
690
690
}
691
691
} else if p [0 ] == 0x08 {
692
692
// wifi
693
693
msg := das.UplinkMsgWifi {
694
694
MsgType : "wifi" ,
695
- Payload : helpers .HEXBytes (p [2 :]),
695
+ Payload : helpers .HEXBytes (append ([] byte { 0x01 }, p [2 :]... ) ),
696
696
Timestamp : float64 (helpers .GetTimestamp (pl .RxInfo ).UnixNano ()) / float64 (time .Second ),
697
697
}
698
698
@@ -704,7 +704,7 @@ func (i *Integration) streamGeolocWorkaround(ctx context.Context, vars map[strin
704
704
return errors .Wrap (err , "das error" )
705
705
}
706
706
707
- err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl )
707
+ err = i .handleDASResponse (ctx , vars , devEUI , resp , ii , pl , common . LocationSource_GEO_RESOLVER_WIFI )
708
708
if err != nil {
709
709
return errors .Wrap (err , "handle das response error" )
710
710
}
0 commit comments