Skip to content

Commit

Permalink
Cleaned up the initialization of the query substructures.
Browse files Browse the repository at this point in the history
  • Loading branch information
edorfaus committed Apr 7, 2012
1 parent 8cc6eef commit 9761732
Showing 1 changed file with 40 additions and 20 deletions.
60 changes: 40 additions & 20 deletions libtempered/temper_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ struct temper_type known_temper_types[]={
.sensor_group_count = 1,
.sensor_groups = (struct tempered_type_hid_sensor_group[]){
{
.query.length = 8,
.query.data = (unsigned char[]){ 1, 0x80, 0x33, 1, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 1, 0x80, 0x33, 1, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group,
.sensor_count = 1,
.sensors = (struct tempered_type_hid_sensor[]){
Expand Down Expand Up @@ -86,8 +88,10 @@ struct temper_type known_temper_types[]={
.sensor_group_count = 1,
.sensor_groups = (struct tempered_type_hid_sensor_group[]){
{
.query.length = 8,
.query.data = (unsigned char[]){ 1, 0x80, 0x33, 1, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 1, 0x80, 0x33, 1, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group,
.sensor_count = 1,
.sensors = (struct tempered_type_hid_sensor[]){
Expand All @@ -112,8 +116,10 @@ struct temper_type known_temper_types[]={
.sensor_group_count = 1,
.sensor_groups = (struct tempered_type_hid_sensor_group[]){
{
.query.length = 8,
.query.data = (unsigned char[]){ 1, 0x80, 0x33, 1, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 1, 0x80, 0x33, 1, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group,
.sensor_count = 2,
.sensors = (struct tempered_type_hid_sensor[]){
Expand Down Expand Up @@ -150,8 +156,10 @@ struct temper_type known_temper_types[]={
.get_subtype_id = tempered_type_hid_get_subtype_id,
.get_subtype_data = &(struct tempered_type_hid_subtype_data){
.id_offset = 2,
.query.length = 8,
.query.data = (unsigned char[]){ 0x52, 0, 0, 0, 0, 0, 0, 0 }
.query = {
.length = 8,
.data = (unsigned char[]){ 0x52, 0, 0, 0, 0, 0, 0, 0 }
}
// calibration is in offsets 2,3 for internal and 4,5 for external
// sensor, at least for some types - but I don't know how to use it
},
Expand All @@ -169,8 +177,10 @@ struct temper_type known_temper_types[]={
.sensor_group_count = 1,
.sensor_groups = (struct tempered_type_hid_sensor_group[]){
{
.query.length = 8,
.query.data = (unsigned char[]){ 0x54, 0, 0, 0, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 0x54, 0, 0, 0, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group,
.sensor_count = 1,
.sensors = (struct tempered_type_hid_sensor[]){
Expand All @@ -195,8 +205,10 @@ struct temper_type known_temper_types[]={
.sensor_group_count = 2,
.sensor_groups = (struct tempered_type_hid_sensor_group[]){
{ // Internal sensor
.query.length = 8,
.query.data = (unsigned char[]){ 0x54, 0, 0, 0, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 0x54, 0, 0, 0, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group,
.sensor_count = 1,
.sensors = (struct tempered_type_hid_sensor[]){
Expand All @@ -208,8 +220,10 @@ struct temper_type known_temper_types[]={
}
},
{ // External sensor
.query.length = 8,
.query.data = (unsigned char[]){ 0x53, 0, 0, 0, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 0x53, 0, 0, 0, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group,
.sensor_count = 1,
.sensors = (struct tempered_type_hid_sensor[]){
Expand All @@ -235,8 +249,10 @@ struct temper_type known_temper_types[]={
.sensor_group_count = 1,
.sensor_groups = (struct tempered_type_hid_sensor_group[]){
{
.query.length = 8,
.query.data = (unsigned char[]){ 0x48, 0, 0, 0, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 0x48, 0, 0, 0, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group,
.sensor_count = 1,
.sensors = (struct tempered_type_hid_sensor[]){
Expand Down Expand Up @@ -265,8 +281,10 @@ struct temper_type known_temper_types[]={
.sensor_group_count = 2,
.sensor_groups = (struct tempered_type_hid_sensor_group[]){
{ // Internal sensor
.query.length = 8,
.query.data = (unsigned char[]){ 0x54, 0, 0, 0, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 0x54, 0, 0, 0, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group,
.sensor_count = 1,
.sensors = (struct tempered_type_hid_sensor[]){
Expand All @@ -278,8 +296,10 @@ struct temper_type known_temper_types[]={
}
},
{ // External sensor
.query.length = 8,
.query.data = (unsigned char[]){ 0x41, 0, 0, 0, 0, 0, 0, 0 },
.query = {
.length = 8,
.data = (unsigned char[]){ 0x41, 0, 0, 0, 0, 0, 0, 0 }
},
.read_sensors = tempered_type_hid_read_sensor_group_ntc,
.sensor_count = 1,
.sensors = (struct tempered_type_hid_sensor[]){
Expand Down

0 comments on commit 9761732

Please sign in to comment.