service is not defined error when running bluetooth developer studio plugin

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

service is not defined error when running bluetooth developer studio plugin

849 次查看
fittrack
Contributor II

Hi!
While running the bluetooth developer studio plugin v1.0.0 code generator with some custom services I was running into a runtime error "service is not defined".

I digged a bit into the code of Plugin.js and found that the variable service is indeed used without declaration and that the following changeset to fix the issue.

@@ -741,7 +741,7 @@ function GetGapScanningAndAdvertisingData() {
         for (var i = 0; i < GAPProperties.ServicesAdvertisement.length; i++) {
             var serviceAdvertisement = GAPProperties.ServicesAdvertisement[i];
             // generate only custom services
-            if (serviceAdvertisement.Selected && isCustom(serviceAdvertisement) && service.UUID.length > 8) {
+               if (serviceAdvertisement.Selected && isCustom(serviceAdvertisement) && serviceAdvertisement.UUID.length > 8) {
                     var uuidArray = serviceAdvertisement.UUID.match(/.{1,2}/g)
                          .map(function (a) {
                               #return "0x" + a;

This is just to let both NXP know about the issue and help others in the same situation.

Kind regards,

Bernhard

标签 (1)
0 回复数