User Tools

Site Tools


hvacboard

root@h3ulcb:~# cansend sllin0 030#FFFFFFF0FF010000

root@h3ulcb:~# cansend sllin0 030#000000F000010000

root@h3ulcb:~#

static int write_can(afb_api_t api) {

  json_object *jresp = json_object_new_object();
  json_object *jobj = json_object_new_object();
  json_object *jarray = json_object_new_array();
  json_object_object_add(jresp, "bus_name", json_object_new_string("ls"));
  json_object_object_add(jresp, "frame", jobj);
  json_object_object_add(jobj, "can_id", json_object_new_int(0x30));
  json_object_object_add(jobj, "can_dlc", json_object_new_int(8));
  json_object_array_add(jarray,
      json_object_new_int(to_can_temp(read_temp_left_zone())));
  json_object_array_add(jarray,
      json_object_new_int(to_can_temp(read_temp_right_zone())));
  json_object_array_add(jarray,
      json_object_new_int(to_can_temp(read_temp())));
  json_object_array_add(jarray, json_object_new_int(0xf0));
  json_object_array_add(jarray, json_object_new_int(read_fanspeed()));
  json_object_array_add(jarray, json_object_new_int(1));
  json_object_array_add(jarray, json_object_new_int(0));
  json_object_array_add(jarray, json_object_new_int(0));
  json_object_object_add(jobj, "can_data", jarray);
  return afb_api_call_sync(api, "low-can", "write", jresp, NULL, NULL, NULL);

}

So ….

030# aa bb cc dd ee ff gg hh

where “aa” == '20' Temp left where “bb” == '24' temp right where “cc” == '22' # average of aa and bb (uint8_t)1) » 1); where “dd” == 'F0' where “ee” == 'FF' # full fan speed where “ff” == '01' 1 where “gg” == '00' 0 where “gg” == '00' 0

1)
(int)read_temp_left_zone() + (int)read_temp_right_zone(
hvacboard.txt · Last modified: 2022/05/11 16:38 by jsmoeller