خرید بک لینک

I want to synchronize the time between my android device and a raspberry pi. My android is synchronized automatically from the inteet ( GMT + 2). I used this code to get the ntp server.

final Resources res = this.getResources();
        final int id = Resources.getSystem().getIdentifier(
                "config_ntpServer", "string","android");
        final String defaultServer = res.getString(id);
        Log.i("time",defaultServer);

Then I used this command to update the time on the raspberry working with the raspbian OS

sudo ntpdate -u 2.android.pool.ntp.org
24 Apr 17:07:06 ntpdate[20038]: adjust time server 77.20.139.240 offset 0.007060 sec

There is still 2 hours difference between the android and the linux. How can I set this GMT + 2 in linux ? Is such synchronization precise? I want to start advertising a beacon with the raspberry pi and measure the time it get to the android device to detect it so I will compare the two time stamps and the result will be in order of ms.

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 6 ارديبهشت 1395 ساعت: 0:49

صفحه بندی