Ver a proveniência

Added Hardware namespace

tags/v1.2.0
Bertrand Lemasle há 7 anos
ascendente
cometimento
b8f6505bd8
3 ficheiros alterados com 62 adições e 1 eliminações
  1. +1
    -1
      GpsTracker/GpsTracker.ino
  2. +38
    -0
      GpsTracker/Hardware.cpp
  3. +23
    -0
      GpsTracker/Hardware.h

+ 1
- 1
GpsTracker/GpsTracker.ino Ver ficheiro

@@ -33,5 +33,5 @@ void loop() {
positions::send();
}

mainunit::deepSleep(10);
mainunit::deepSleep(10); //duration TBD
}

+ 38
- 0
GpsTracker/Hardware.cpp Ver ficheiro

@@ -0,0 +1,38 @@
#include "Hardware.h"
#include "Pins.h"

#include <SIM808.h>

namespace hardware {

namespace sim808 {
SoftwareSerial simSerial = SoftwareSerial(SIM_TX, SIM_RX);
SIM808 sim = SIM808(0, SIM_PWR, SIM_STATUS);
//idea : int powered
//gps::powerOn() => +1
//network::powerOn() => +1
//gps::powerOff() => -1
//network::powerOff() => -1

//sim808:powerOff() => force powerOff of both
//gps/network::powerOff() => powered == 1 => sim808::powerOff()
//idea : gps power on = +1, network power on = +1 => powerOff forces power off of all, powerOff one will lead to actual powerOff if
void powerOn() {

}

void powerOff() {

}
}

namespace rtc {
void powerOn();
void powerOff();
}

namespace eeprom {
void powerOn();
void powerOff();
}
}

+ 23
- 0
GpsTracker/Hardware.h Ver ficheiro

@@ -0,0 +1,23 @@
#pragma once

#include <SIM808.h>

namespace hardware {

namespace sim808 {
extern SIM808 device;

void powerOn();
void powerOff();
}

namespace rtc {
void powerOn();
void powerOff();
}

namespace eeprom {
void powerOn();
void powerOff();
}
}

Carregando…
Cancelar
Guardar