บทความ

กำลังแสดงโพสต์จาก พฤศจิกายน, 2019

line beacon arduino ide

การหา line beacon hw id https://admin-official.line.me/beacon/ ///////////////////////////////////////////////////////////////////// #include "bt.h" #include "esp_gap_ble_api.h" static const uint8_t HWID[5] = {0x01, 0x1a, 0xa6, 0xf1, 0x09};  // LINE 011aa6f109 static const uint8_t ADC_PIN = 35; static const float R1 = 4000.0; static const float R2 = 2000.0; static const uint16_t UUID_FOR_LINECORP = 0xFE6F; static const uint8_t  MAX_SIMPLEBEACON_DEVICEMESSAGE_SIZE = 13; static uint8_t deviceMessageSize = 1; static uint8_t deviceMessage[MAX_SIMPLEBEACON_DEVICEMESSAGE_SIZE]; static const uint8_t  MAX_BLE_ADVERTISING_DATA_SIZE = 31; static const uint16_t HCI_LE_Set_Advertising_Data   = (0x08 << 10) | 0x0008; static const uint16_t HCI_LE_Set_Advertising_Enable = (0x08 << 10) | 0x000A; static void _dump(const char * title, uint8_t *data, size_t dataSize) {   Serial.printf("%s [%d]:", title, dataSize);   for (size_t i = 0;

webhook line beacon example

<?php header('Content-Type: application/json'); date_default_timezone_set("Asia/Bangkok"); $datef = date('Y-m-d'); $json = file_get_contents('php://input'); $request = json_decode($json, true); $userId = $request['events'][0]['source']['userId']; $Type = $request['events'][0]['beacon']['type']; $a ="\n\r\n userid = ".$userId; $b ="\n\r\n Type = ".$Type; $myfile = fopen("log$datef.txt", "w") or die("Unable to open file!"); fwrite($myfile,$json); fwrite($myfile,$a); fwrite($myfile,$b); fclose($myfile); if($Type ='enter'){ $curl = curl_init(); curl_setopt_array($curl, array(   CURLOPT_URL => "https://api.line.me/v2/bot/message/push",   CURLOPT_RETURNTRANSFER => true,   CURLOPT_ENCODING => "",   CURLOPT_MAXREDIRS => 10,   CURLOPT_TIMEOUT => 30,   CURLOPT_HTTP_VERSION => CURL_HTT