X-Git-Url: https://git.karo-electronics.de/?p=oswald.git;a=blobdiff_plain;f=ui%2Foswald-ui.c;h=563a7b7e51792cebc7252e2e0463a10d0a375286;hp=e86f0e1593bc9a930d3bf8aa1be13e3009f01685;hb=b83e605bc8ba69950a84b6ed268f0c196f68762c;hpb=5d0ff002cee35d109f4a60eff415b2db556fb8f4 diff --git a/ui/oswald-ui.c b/ui/oswald-ui.c index e86f0e1..563a7b7 100644 --- a/ui/oswald-ui.c +++ b/ui/oswald-ui.c @@ -35,7 +35,6 @@ void hal_lcd_set_pixel(gint x, gint y, gboolean state) gdk_draw_point(GDK_DRAWABLE(ui_g->pixmap), state ? ui_g->darea->style->black_gc : ui_g->darea->style->white_gc, ix, iy+1); gdk_draw_point(GDK_DRAWABLE(ui_g->pixmap), state ? ui_g->darea->style->black_gc : ui_g->darea->style->white_gc, ix+1, iy+1); -// gtk_widget_queue_draw(ui_g->darea); } /* updates the actual LCD so that drawing becomes visible */ @@ -56,6 +55,45 @@ void hal_lcd_clear_display(void) gtk_widget_queue_draw(ui_g->darea); } +static bluetooth_state bt_state = BLUETOOTH_OFF; +static boolean bt_visible = FALSE; + +bluetooth_state hal_bluetooth_set_state(bluetooth_state state) +{ + bt_state = state; + if (bt_state == BLUETOOTH_OFF) + bt_visible = FALSE; + + return bt_state; +} + +bluetooth_state hal_bluetooth_get_state(void) +{ + return bt_state; +} + +uint8_t *hal_bluetooth_get_local_bdaddr(void) +{ + static uint8_t local_bdaddr[6] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55}; + + return local_bdaddr; +} + +void hal_bluetooth_set_visible(boolean visible) +{ + bt_visible = visible; +} + +boolean hal_bluetooth_get_visible(void) +{ + return bt_visible; +} + +void hal_bluetooth_send_data(const void *mdat, uint16_t mlen) +{ + g_printerr("write comm %d\n", mlen); +} + static gint configure_event (GtkWidget *widget, GdkEventConfigure *event, gpointer user_data) {