{"action":"created","issue":{"url":"https://api.github.com/repos/sandeepmistry/noble/issues/305","labels_url":"https://api.github.com/repos/sandeepmistry/noble/issues/305/labels{/name}","comments_url":"https://api.github.com/repos/sandeepmistry/noble/issues/305/comments","events_url":"https://api.github.com/repos/sandeepmistry/noble/issues/305/events","html_url":"https://github.com/sandeepmistry/noble/issues/305","id":128183242,"number":305,"title":"Scan response, differences between mac & linux","user":{"login":"rosek86","id":10393406,"avatar_url":"https://avatars.githubusercontent.com/u/10393406?v=3","gravatar_id":"","url":"https://api.github.com/users/rosek86","html_url":"https://github.com/rosek86","followers_url":"https://api.github.com/users/rosek86/followers","following_url":"https://api.github.com/users/rosek86/following{/other_user}","gists_url":"https://api.github.com/users/rosek86/gists{/gist_id}","starred_url":"https://api.github.com/users/rosek86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosek86/subscriptions","organizations_url":"https://api.github.com/users/rosek86/orgs","repos_url":"https://api.github.com/users/rosek86/repos","events_url":"https://api.github.com/users/rosek86/events{/privacy}","received_events_url":"https://api.github.com/users/rosek86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-22T15:45:09Z","updated_at":"2016-01-23T16:05:12Z","closed_at":null,"body":"Hi,\r\n\r\nIt seems that on Linux Noble tries to merge advertisement and scan response together, which is a good way to handle this. However, if manufacturerData is presence in both; advertisement and scan response Noble returns only scan response field. Issue is with gap.js, line 137:  \r\n\r\nhttps://github.com/sandeepmistry/noble/blob/master/lib/hci-socket/gap.js#L137\r\n\r\nI believe that best way is to merge manufacturer data fields together, like it's done on iOS:\r\n\r\n    if (type === 0x04) {\r\n      hasScanResponse = true;\r\n    } else {\r\n      // reset service data every non-scan response event\r\n      advertisement.serviceData = [];\r\n      advertisement.serviceUuids = [];\r\n      advertisement.manufacturerData = undefined;\r\n    }\r\n    ...\r\n    case 0xff: // Manufacturer Specific Data\r\n      if (advertisement.manufacturerData !== undefined) {\r\n        advertisement.manufacturerData = Buffer.concat([advertisement.manufacturerData, bytes]);\r\n      } else {\r\n        advertisement.manufacturerData = bytes;\r\n      }\r\n\r\nThe mac version shows different behaviour, It seems that I get two separate events for advertisement and scan response.\r\n\r\nBR,\r\nKrzysztof\r\n"},"comment":{"url":"https://api.github.com/repos/sandeepmistry/noble/issues/comments/174196402","html_url":"https://github.com/sandeepmistry/noble/issues/305#issuecomment-174196402","issue_url":"https://api.github.com/repos/sandeepmistry/noble/issues/305","id":174196402,"user":{"login":"sandeepmistry","id":1163840,"avatar_url":"https://avatars.githubusercontent.com/u/1163840?v=3","gravatar_id":"","url":"https://api.github.com/users/sandeepmistry","html_url":"https://github.com/sandeepmistry","followers_url":"https://api.github.com/users/sandeepmistry/followers","following_url":"https://api.github.com/users/sandeepmistry/following{/other_user}","gists_url":"https://api.github.com/users/sandeepmistry/gists{/gist_id}","starred_url":"https://api.github.com/users/sandeepmistry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandeepmistry/subscriptions","organizations_url":"https://api.github.com/users/sandeepmistry/orgs","repos_url":"https://api.github.com/users/sandeepmistry/repos","events_url":"https://api.github.com/users/sandeepmistry/events{/privacy}","received_events_url":"https://api.github.com/users/sandeepmistry/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T16:05:12Z","updated_at":"2016-01-23T16:05:12Z","body":"@rosek86 can you please share an example of the manufacturer data in the advertisement data and scan data, and how CoreBluetooth on iOS and OS X report it?"}}