Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ set(SRC_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/common/tools.cpp

## Modules
# Server Module
# Net Module
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/net_module/socket.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/net_module/nrf9160_setup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/net_module/net_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/net_module/net_scheduler.cpp

# Tracking Module
${CMAKE_CURRENT_SOURCE_DIR}/src/modules/tracking_module/tracking_module.cpp
)

# target_include_directories(app PRIVATE
Expand Down
10 changes: 10 additions & 0 deletions prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ CONFIG_LTE_LINK_CONTROL=y
CONFIG_PDN=y
CONFIG_PDN_ESM_STRERROR=y

CONFIG_NRF_CLOUD_REST=y
CONFIG_MODEM_INFO=y
CONFIG_NRF_CLOUD_AGNSS=y
CONFIG_LOCATION=y
CONFIG_LOCATION_SERVICE_NRF_CLOUD=y

CONFIG_MODEM_JWT=y

CONFIG_POSIX_CLOCK=y

CONFIG_SPI=y

CONFIG_BOOTLOADER_MCUBOOT=y
4 changes: 2 additions & 2 deletions src/common/location.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

struct Location {
double lat;
double lon;
double lat;
double lon;
};
62 changes: 0 additions & 62 deletions src/main.c

This file was deleted.

63 changes: 29 additions & 34 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,47 +1,42 @@
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>

#include <app_event_manager.h>

#include "common/van_info.h"
#include "common/location.h"

#include "modules/net_module/net_module.h"

#define LED0_NODE DT_ALIAS(led0)
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);

#define SLEEP_TIME_MS 2000
#include "modules/tracking_module/tracking_module.h"
#include "modules/tracking_module/tracking_event.h"
#include "modules/tracking_module/tracking_exception.h"

VanInfo van_info;

int main() {
OC_LOG_INFO("Welcome to the OreCart Hardware Project!");
int ret;

net_module_init();

if (!gpio_is_ready_dt(&led)) {
return 0;
}

ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
if (ret < 0) {
return 0;
}

struct VanInfo van_info = {
.van_id = 1
};

struct Location location = {.lat=213.12, .lon=20.123};

while (1) {
forward_van_location(van_info, location, 100);
k_sleep(K_SECONDS(20));
}

while (1) {
k_sleep(K_SECONDS(15));
}
OC_LOG_INFO("Welcome to the OreCart Hardware Project!");
int ret;

net_module_init();

try {
tracking_module_init();
} catch (TrackingException e) {
OC_LOG_ERROR(e.toStr());
}

while (true) {
k_sleep(K_SECONDS(1));
}

return 0;
}

return 0;
static bool _app_event_handler(const struct app_event_header *aeh) {
if (is_tracking_event(aeh)) {

}
}

APP_EVENT_LISTENER(main, _app_event_handler);
APP_EVENT_SUBSCRIBE(main, tracking_event);
135 changes: 0 additions & 135 deletions src/modules/server_module/nrf9160_setup.c

This file was deleted.

3 changes: 0 additions & 3 deletions src/modules/server_module/nrf9160_setup.h

This file was deleted.

Loading