add method

void add(
  1. int idx
)

Implementation

void add(int idx) {
  final p = malloc<PERIPHERAL_WEATHER_DATA>();
  p.ref.month = month;
  p.ref.day = day;
  p.ref.type = type;
  p.ref.temperature_low = temperature_low;
  p.ref.temperature_high = temperature_high;
  p.ref.aqi = aqi;
  clingNative.cwsUpdateWeatherForecast(p, idx);
  malloc.free(p);
  clingNative.cwsSendWeather();
}