Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus K Wilting authored and Klaus K Wilting committed May 27, 2018
2 parents 1aa0aef + b9e3961 commit 73d6f30
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/antenna.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <Arduino.h>

// Local logging tag
static const char *TAG = "antenna";
static const char* TAG = "wifi";

typedef enum {
ANTENNA_INT = 0,
Expand Down
7 changes: 3 additions & 4 deletions src/blecsan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define BT_BD_ADDR_HEX(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]

// local Tag for logging
static const char *TAG = "blescan";
static const char* TAG = "bluetooth";

// defined in macsniff.cpp
bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type);
Expand Down Expand Up @@ -92,9 +92,8 @@ static const char *btsig_gap_type(uint32_t gap_type) {
IRAM_ATTR static void gap_callback_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
{
esp_ble_gap_cb_param_t *p = (esp_ble_gap_cb_param_t *)param;
esp_err_t status;

ESP_LOGD(tag, "BT payload rcvd -> type: 0x%.2x -> %s", *p->scan_rst.ble_adv, btsig_gap_type(*p->scan_rst.ble_adv));

ESP_LOGD(TAG, "BT payload rcvd -> type: 0x%.2x -> %s", *p->scan_rst.ble_adv, btsig_gap_type(*p->scan_rst.ble_adv));

switch (event)
{
Expand Down
2 changes: 1 addition & 1 deletion src/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <nvs_flash.h>

// Local logging tag
static const char *TAG = "configmanager";
static const char* TAG = "flash";

nvs_handle my_handle;

Expand Down
8 changes: 3 additions & 5 deletions src/lorawan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#endif

// Local logging Tag
static const char *TAG = "lorawan";
static const char* TAG = "lora";

// functions defined in rcommand.cpp
void rcommand(uint8_t cmd, uint8_t arg);
Expand Down Expand Up @@ -79,8 +79,6 @@ void get_hard_deveui(uint8_t *pdeveui) {

// Display a key
void printKey(const char * name, const uint8_t * key, uint8_t len, bool lsb) {
uint8_t start=lsb?len:0;
uint8_t end = lsb?0:len;
const uint8_t * p ;
char keystring[len+1] = "", keybyte[3];
for (uint8_t i=0; i<len ; i++) {
Expand Down Expand Up @@ -170,7 +168,7 @@ void onEvent (ev_t ev) {
case EV_JOINED:

strcpy_P(buff, PSTR("JOINED"));
sprintf(display_lora, ""); // clear previous lmic status message from display
sprintf(display_lora, " "); // clear previous lmic status message from display

// Disable link check validation (automatically enabled
// during join, but not supported by TTN at this time). -> do we need this?
Expand All @@ -188,7 +186,7 @@ void onEvent (ev_t ev) {
case EV_TXCOMPLETE:

strcpy_P(buff, (LMIC.txrxFlags & TXRX_ACK) ? PSTR("RECEIVED ACK") : PSTR("TX COMPLETE"));
sprintf(display_lora, ""); // clear previous lmic status message from display
sprintf(display_lora, " "); // clear previous lmic status message from display

if (LMIC.dataLen) {
ESP_LOGI(TAG, "Received %d bytes of payload, RSSI %d SNR %d", LMIC.dataLen, LMIC.rssi, (signed char)LMIC.snr / 4);
Expand Down
4 changes: 1 addition & 3 deletions src/macsniff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
#include "globals.h"

#ifdef VENDORFILTER
#include <array>
#include <algorithm>
#include "vendor_array.h"
#endif

// Local logging tag
static const char *TAG = "macsniff";
static const char* TAG = "wifi";

static wifi_country_t wifi_country = {.cc=WIFI_MY_COUNTRY, .schan=WIFI_CHANNEL_MIN, .nchan=WIFI_CHANNEL_MAX, .policy=WIFI_COUNTRY_POLICY_MANUAL};

Expand Down
8 changes: 2 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ std::set<uint16_t> macs; // associative container holds total of unique MAC adre
static volatile int ButtonPressed = 0, DisplayTimerIRQ = 0, ChannelTimerIRQ = 0;

// local Tag for logging
static const char *TAG = "paxcnt";
// Note: Log level control seems not working during runtime,
// so we need to switch loglevel by compiler build option in platformio.ini
static const char* TAG = "main";

#ifndef VERBOSE
int redirect_log(const char * fmt, va_list args) {
Expand Down Expand Up @@ -241,8 +239,6 @@ uint64_t uptime() {

// Print a key on display
void DisplayKey(const uint8_t * key, uint8_t len, bool lsb) {
uint8_t start=lsb?len:0;
uint8_t end = lsb?0:len;
const uint8_t * p ;
for (uint8_t i=0; i<len ; i++) {
p = lsb ? key+len-i-1 : key+i;
Expand Down Expand Up @@ -413,7 +409,7 @@ uint64_t uptime() {
// small blink 10ms on each 1/2sec (not when joining)
LEDState = ((millis() % 500) < 20) ? LED_ON : LED_OFF;
// This should not happen so indicate a problem
} else if ( LMIC.opmode & (OP_TXDATA | OP_TXRXPEND | OP_JOINING | OP_REJOIN) == 0 ) {
} else if ( LMIC.opmode & ((OP_TXDATA | OP_TXRXPEND | OP_JOINING | OP_REJOIN) == 0 ) ) {
LEDColor = COLOR_RED;
// heartbeat long blink 200ms on each 2 seconds
LEDState = ((millis() % 2000) < 200) ? LED_ON : LED_OFF;
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// program version - note: increment version after modifications to configData_t struct!!
#define PROGVERSION "1.3.51" // use max 10 chars here!
#define PROGVERSION "1.3.6" // use max 10 chars here!
#define PROGNAME "PAXCNT"

//--- Declarations ---
Expand Down
2 changes: 1 addition & 1 deletion src/rcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <hal/hal.h>

// Local logging tag
static const char *TAG = "rcommand";
static const char* TAG = "main";

// table of remote commands and assigned functions
typedef struct {
Expand Down

0 comments on commit 73d6f30

Please sign in to comment.