Skip to content
Snippets Groups Projects
Commit d5a239ae authored by Adrien Chabod's avatar Adrien Chabod
Browse files

test sql

parent d79c9b42
No related branches found
No related tags found
1 merge request!1MAJ BDD + Data commande fonctionnel
......@@ -28,10 +28,8 @@ SQL_GET_COCKTAIL_COMPOSITION_WITHOUT_BEC_CHARACTERISTIC_UUID = "6e4a0005-
SQL_GET_COCKTAIL_COMPOSITION_WITH_BEC_CHARACTERISTIC_UUID = "6e4a0006-b5a3-f393-e0a9-e50e24dcca9e"
MACHINE_SEND_ORDER_CHARACTERISTIC_UUID = "6e4a0007-b5a3-f393-e0a9-e50e24dcca9e"
SQL_PUT_COCKTAIL_CHARACTERISTIC_UUID = "6e4a0008-b5a3-f393-e0a9-e50e24dcca9e"
SQL_PUT_INGREDIENT_CHARACTERISTIC_UUID = "6e4a0009-b5a3-f393-e0a9-e50e24dcca9e"
SQL_ADD_INGREDIENT_CHARACTERISTIC_UUID = "6e4a0009-b5a3-f393-e0a9-e50e24dcca9e"
SQL_MAJ_MACHINE_CHARACTERISTIC_UUID = "6e4a0010-b5a3-f393-e0a9-e50e24dcca9e"
SQL_GET_BEC_FROM_INGREDIENT_CHARACTERISTIC_UUID = "6e4a0011-b5a3-f393-e0a9-e50e24dcca9e"
SQL_ADD_INGREDIENT_CHARACTERISTIC_UUID = "6e4a0012-b5a3-f393-e0a9-e50e24dcca9e"
mainloop = None
class TxCharacteristic(Characteristic):
......@@ -95,8 +93,7 @@ class UartService(Service):
self.add_characteristic(BLE_GET_INGREDIENT_LIST(bus, 2, self))
self.add_characteristic(BLE_GET_QUANTITE_MACHINE(bus, 3, self))
self.add_characteristic(BLE_MACHINE_SEND_ORDER(bus, 4, self))
self.add_characteristic(BLE_GET_BEC_FROM_INGREDIENT(bus, 5, self))
self.add_characteristic(BLE_ADD_INGREDIENT(bus, 6, self))
self.add_characteristic(BLE_ADD_INGREDIENT(bus, 5, self))
class Application(dbus.service.Object):
def __init__(self, bus):
......@@ -164,13 +161,6 @@ class BLE_GET_QUANTITE_MACHINE(TxCharacteristic):
def do_something(self):
self.send_tx(formalize_data_list(mysql_get_quantite_machine))
class BLE_GET_BEC_FROM_INGREDIENT(TxCharacteristic):
def __init__(self, bus, index, service):
TxCharacteristic.__init__(self, bus, index, service, SQL_GET_BEC_FROM_INGREDIENT_CHARACTERISTIC_UUID)
def do_something(self):
self.send_tx(formalize_data_list(mysql_get_bec_from_ingredient))
class BLE_ADD_INGREDIENT(RxCharacteristic):
def __init__(self, bus, index, service):
RxCharacteristic.__init__(self, bus, index, service, SQL_ADD_INGREDIENT_CHARACTERISTIC_UUID)
......
from .bibliotheques.sql.sql import *
print(mysql_get_cocktail_list())
print(mysql_get_ingredient_list())
print(mysql_get_quantite_machine())
print(mysql_get_all_cocktail_composition_without_bec())
print(mysql_get_cocktail_composition_without_bec(1))
print(mysql_get_cocktail_composition_with_bec(1))
print(mysql_get_bec_from_ingredient(1))
mysql_add_ingredient("test")
from bibliotheques.sql.sql import formalize_data_list, unformalize_data_list
input = "0,None,None/1,6,0/2,2,0/3,None,None/4,None,None/5,None,None"
unformalize_data_list(input)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment