Major update
- Working client server interactions - Can create radio config - Needs radio testing
This commit is contained in:
30
Client/routes/radio.js
Normal file
30
Client/routes/radio.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// Controllers
|
||||
const radioController = require("../controllers/radioController");
|
||||
// Debug
|
||||
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
||||
const log = new DebugBuilder("client", "clientController");
|
||||
// Modules
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
/**
|
||||
* POST Open a new radio session
|
||||
* This will open OP25 to the current specified radio settings
|
||||
*/
|
||||
router.post('/start', radioController.openRadioSession);
|
||||
|
||||
/**
|
||||
* POST Close the current radio session
|
||||
*/
|
||||
router.post('/stop', radioController.closeRadioSession);
|
||||
|
||||
/** POST change current radio preset
|
||||
* This will change the bot to the preset specified (if different from what is currently playing)
|
||||
* @param req The request sent from the master
|
||||
* @param {string} req.body.presetName The name of the system to be updated
|
||||
* The status of the bot: 200 = no change, 202 = changed successfully, 500 + JSON = encountered error
|
||||
* @returns status
|
||||
*/
|
||||
router.post('/changeConfig', radioController.changeCurrentConfig);
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user