MCPcopy Create free account
hub / github.com/FedeDP/Clight / cache_location

Function cache_location

src/modules/location.c:288–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288static void cache_location(void) {
289 if (state.current_loc.lat != LAT_UNDEFINED && state.current_loc.lon != LON_UNDEFINED) {
290 FILE *f = fopen(cache_file, "w");
291 if (f) {
292 fprintf(f, "%lf %lf\n", state.current_loc.lat, state.current_loc.lon);
293 DEBUG("Latest location stored in cache file!\n");
294 fclose(f);
295 } else {
296 WARN("Caching location failed: %s.\n", strerror(errno));
297 }
298 }
299}
300
301static void publish_location(double new_lat, double new_lon, message_t *l) {
302 l->loc.old.lat = state.current_loc.lat;

Callers 1

receiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected