Init
This commit is contained in:
commit
1d06ab8561
|
|
@ -0,0 +1,13 @@
|
||||||
|
//
|
||||||
|
// Created by xemon on 17.11.22.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef UVEOS_ON_NATION_AUDIOPLAYERTELITLE910_H
|
||||||
|
#define UVEOS_ON_NATION_AUDIOPLAYERTELITLE910_H
|
||||||
|
|
||||||
|
#include "AtGsmTelitLe910.h"
|
||||||
|
#include "AudioPlayerInterface.h"
|
||||||
|
|
||||||
|
tAudioPlayerInterface AudioPlayerTelitLe910_GetInterface(tAtCmd *telitAt);
|
||||||
|
|
||||||
|
#endif //UVEOS_ON_NATION_AUDIOPLAYERTELITLE910_H
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
//
|
||||||
|
// Created by xemon on 17.11.22.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <memory.h>
|
||||||
|
#include "AudioPlayerTelitLe910.h"
|
||||||
|
#include "SystemDelayInterface.h"
|
||||||
|
|
||||||
|
static bool AudioPlayerTelitLe910_Start(tAtCmd *telitAt, char *name, uint16_t nameLen, uint32_t timeout) {
|
||||||
|
char fileName[nameLen + 4];
|
||||||
|
|
||||||
|
memcpy(fileName, name, nameLen);
|
||||||
|
stpncpy(fileName + nameLen, ".pcm", 4);
|
||||||
|
|
||||||
|
if(AtGsmTelitLe910_PlayAudioFileTo(telitAt, TELIT_AUDIO_FILE_PLAY_TO_SPEAKER, fileName, nameLen + 4) == AT_OK){
|
||||||
|
return AtCmdWaitOk(telitAt, 10, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool AudioPlayerTelitLe910_Stop(tAtCmd *telitAt, uint32_t timeout) {
|
||||||
|
return AtGsmTelitLe910_PlayAudioStop(telitAt) == AT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool AudioPlayerTelitLe910_Wait(tAtCmd *atCmd, uint32_t timeout) {
|
||||||
|
AtCommandResult result= AtGsmTelitLe910_PlayAudioWaitEnd(atCmd, timeout);
|
||||||
|
if(result == AT_OK){
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
AudioPlayerTelitLe910_Stop(atCmd, timeout);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tAudioPlayerInterface AudioPlayerTelitLe910_GetInterface(tAtCmd *telitAt) {
|
||||||
|
tAudioPlayerInterface result = {
|
||||||
|
.env = telitAt,
|
||||||
|
.start = (audioPlayerCallStart) AudioPlayerTelitLe910_Start,
|
||||||
|
.stop = (audioPlayerCall) AudioPlayerTelitLe910_Stop,
|
||||||
|
.wait = (audioPlayerCall) AudioPlayerTelitLe910_Wait,
|
||||||
|
};
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"dep": [
|
||||||
|
],
|
||||||
|
"cmake": {
|
||||||
|
"inc_dirs": [
|
||||||
|
"Inc"
|
||||||
|
],
|
||||||
|
"srcs": [
|
||||||
|
"Src/**.c"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue