def main(): global quit while not quit: print_main_menu() choice = raw_input(" >> ") exec_menu(main_menu, choice) disconnect_sensor() lputils.logd(TAG, "bye")
def main(): quit = False lputils.logd(TAG, "Connecting sensor") if not lpmsSensor.connect(): lputils.loge(TAG, "Error connecting to sensor, terminating..") return lputils.logd(TAG, "Connected") print_data() while not quit: choice = raw_input(" >> ") quit = True stop_print_data() lputils.logd(TAG, "Disconnecting sensor") lpmsSensor.disconnect() lputils.logd(TAG, "Disconnected") lputils.logd(TAG, "bye")
def disconnect_sensor(): lputils.logd(TAG, "Disconnecting sensor") lpmsSensor.disconnect() lputils.logd(TAG, "Disconnected")
def connect_sensor(): lputils.logd(TAG, "Connecting sensor") if lpmsSensor.connect(): lputils.logd(TAG, "Connected") get_config_register()