mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 16:48:29 -04:00
AP_HAL_Linux: document functions to write file
Document function and add attributes to mark then as printf- and scanf-like functions.
This commit is contained in:
parent
821814007e
commit
392879112e
@ -2,7 +2,9 @@
|
||||
#ifndef __AP_HAL_LINUX_UTIL_H__
|
||||
#define __AP_HAL_LINUX_UTIL_H__
|
||||
|
||||
#include <AP_Common/AP_Common.h>
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
|
||||
#include "AP_HAL_Linux_Namespace.h"
|
||||
#include "ToneAlarmDriver.h"
|
||||
|
||||
@ -40,8 +42,19 @@ public:
|
||||
|
||||
uint32_t available_memory(void) override;
|
||||
|
||||
int write_file(const char *path, const char *fmt, ...);
|
||||
int read_file(const char *path, const char *fmt, ...);
|
||||
/*
|
||||
* Write a string as specified by @fmt to the file in @path. Note this
|
||||
* should not be used on hot path since it will open, write and close the
|
||||
* file for each call.
|
||||
*/
|
||||
int write_file(const char *path, const char *fmt, ...) FORMAT(3, 4);
|
||||
|
||||
/*
|
||||
* Read a string as specified by @fmt from the file in @path. Note this
|
||||
* should not be used on hot path since it will open, read and close the
|
||||
* file for each call.
|
||||
*/
|
||||
int read_file(const char *path, const char *fmt, ...) FMT_SCANF(3, 4);
|
||||
|
||||
private:
|
||||
static Linux::ToneAlarm _toneAlarm;
|
||||
|
Loading…
Reference in New Issue
Block a user