4

I have a problem in ble device scan currently i'm trying to scan c2541 with the Android beacon library and i'm not able to find it in list, if i try to scan StickNFind device. or HM device than its work fine.

Following is my some code snippet.

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_ranging);

    mHandler = new Handler();
    beaconManager.bind(RangingActivity.this);
    beaconManager.getBeaconParsers().clear();
    beaconManager.getBeaconParsers().add(new BeaconParser().
            setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24"));
    beaconManager.getBeaconParsers().add(new BeaconParser().
            setBeaconLayout("x,s:0-1=feaa,m:2-2=20,d:3-3,d:4-5,d:6-7,d:8-11,d:12-15"));
    beaconManager.getBeaconParsers().add(new BeaconParser().
            setBeaconLayout("s:0-1=feaa,m:2-2=00,p:3-3:-41,i:4-13,i:14-19"));
    beaconManager.getBeaconParsers().add(new BeaconParser().
            setBeaconLayout("s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-20v"));
    beaconManager.getBeaconParsers().add(new BeaconParser().
            setBeaconLayout("s:0-1=fed8,m:2-2=00,p:3-3:-41,i:4-21v"));

    beaconManager.bind(this);
    //scanning();
}

If does anyone have idea about this than kindly suggest me the solution

I know this question is some what hardware related but having trouble with my above code.

So, any help will be much appreciated Thanks in Advance.

Ajay Pandya
  • 2,417
  • 4
  • 29
  • 65
  • 1
    Is the CC2541 correctly flashed with Eddystone/Android Beacon firmware? Also realize that iBeacon and Eddystone are two different beacon protocols. – Morrison Chang Apr 07 '16 at 05:53
  • Thanks for your response my firmeware is upto date what else can i do can you suggest me the way ?i don't know much about two protocols can you give me some reference and not dip knowledge but i know beacon and my device have different protocol? – Ajay Pandya Apr 07 '16 at 05:59
  • can you suggest me the byte layout for above device ? – Ajay Pandya Apr 07 '16 at 06:01
  • 2
    A real possibility is that there is nothing wrong with the code or byte layouts above but the issue is that the CC2541 isn't transmitting what you want. please try an off-the-shelf beacon detector based on the Android Beacon Library like [Locate](https://play.google.com/store/apps/details?id=com.radiusnetworks.locate&hl=en) and see if it detects the CC2541. This will eliminate the code above and let you know if the CC2541 is transmitting a recognizable beacon format at all. – davidgyoung Apr 07 '16 at 12:19
  • so you mean that i can not manually add UUID of my device in library? – Ajay Pandya Apr 07 '16 at 12:21

1 Answers1

0

the Beacon Layout looks like this:

ScanResult{
 mDevice=68:9E:19:03:E0:EA,
 mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=null,
 mManufacturerSpecificData={
  76=[2, 21, -3, -91, 6, -109, -92, -30, 79, -79, -81, -49, -58, -21, 7, 100, 120, 37, 0, 0, 0, 0, -59]
 },
 mServiceData={00005153-0000-1000-8000-00805f9b34fb=[67]},
 mTxPowerLevel=0,
 mDeviceName=null],
 mRssi=-68,
 mTimestampNanos=442148352896454
}

just find a Layout form for that.

Cheers

sds
  • 58,617
  • 29
  • 161
  • 278