本文整理汇总了C++中set_status函数的典型用法代码示例。如果您正苦于以下问题:C++ set_status函数的具体用法?C++ set_status怎么用?C++ set_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update_status
/*
update the state of the sensor
*/
void AP_RangeFinder_LightWareSerial::update(void)
{
if (get_reading(state.distance_cm)) {
// update range_valid state based on distance measured
last_reading_ms = hal.scheduler->millis();
update_status();
} else if (hal.scheduler->millis() - last_reading_ms > 200) {
set_status(RangeFinder::RangeFinder_NoData);
}
}
示例2: configure_package
void configure_package(deb_file_t *deb_file)
{
const char *package_name = name_hashtable[package_hashtable[deb_file->package]->name];
const char *package_version = name_hashtable[package_hashtable[deb_file->package]->version];
const int status_num = search_status_hashtable(package_name);
int return_value;
printf("Setting up %s (%s)\n", package_name, package_version);
/* Run the preinst prior to extracting */
return_value = run_package_script(package_name, "postinst");
if (return_value == -1) {
/* TODO: handle failure gracefully */
error_msg_and_die("postrm failure.. set status to what?");
}
/* Change status to reflect success */
set_status(status_num, "install", 1);
set_status(status_num, "installed", 3);
}
示例3: move_to_top
static void move_to_top (MaintainrProjectbox *box, MaintainrShell *item)
{
MaintainrProjectconf *conf;
conf = maintainr_projectbox_get_conf (box);
maintainr_config_force_top (item->priv->conf, conf);
set_status (item);
maintainr_config_save (item->priv->conf);
gtk_box_reorder_child (GTK_BOX (item->priv->projects_box), GTK_WIDGET (box), 0);
}
示例4: update_status
/*
update the state of the sensor
*/
void AP_RangeFinder_LeddarOne::update(void)
{
if (get_reading(state.distance_cm)) {
// update range_valid state based on distance measured
last_reading_ms = AP_HAL::millis();
update_status();
} else if (AP_HAL::millis() - last_reading_ms > 200) {
set_status(RangeFinder::RangeFinder_NoData);
}
}
示例5: set_last_status
int set_last_status(alphabet_game_t *alphabet_game, status_t status)
{
alphabet_game_t *ag=alphabet_game;
status_t stts=status;
if(NULL==ag){
return RET_FAILED;
}
return set_status(&ag->last_status,stts);
}
示例6: set_ready_to_punch_if_standing_long
/**
* if we are not moving for a while, set we are ready to punch
*/
void set_ready_to_punch_if_standing_long(int *standing_cycles_count)
{
// standing for long enough
if (*standing_cycles_count > CALIBRATION_CALM_COUNTER_LIMIT)
{
// get ready to punch!
*standing_cycles_count = 0;
set_status(STATE_PUNCH_READY);
}
}
示例7: InstallCallback_OnStartBinding
static HRESULT WINAPI InstallCallback_OnStartBinding(IBindStatusCallback *iface,
DWORD dwReserved, IBinding *pib)
{
set_status(IDS_DOWNLOADING);
IBinding_AddRef(pib);
dwl_binding = pib;
return S_OK;
}
示例8: received_message
/*
* Messages incoming from the phone
*/
void received_message(DictionaryIterator *received, void *context) {
Event temp_event;
Tuple *tuple = dict_find(received, RECONNECT_KEY);
if (tuple) {
vibes_short_pulse();
calendar_request();
}
// Gather the bits of a calendar together
tuple = dict_find(received, CALENDAR_RESPONSE_KEY);
if (tuple) {
set_status(STATUS_REPLY);
uint8_t i, j;
if (g_count > g_received_rows) {
i = g_received_rows;
j = 0;
} else {
g_count = tuple->value->data[0];
i = 0;
j = 1;
}
while (i < g_count && j < tuple->length) {
memcpy(&temp_event, &tuple->value->data[j], sizeof(Event));
if (temp_event.index < MAX_EVENTS)
memcpy(&g_events[temp_event.index], &temp_event, sizeof(Event));
i++;
j += sizeof(Event);
}
g_received_rows = i;
if (g_count == g_received_rows) {
g_max_entries = g_count;
process_rot_events();
if (nothing_showing) {
nothing_showing = false;
show_next_event();
}
battery_request();
}
}
tuple = dict_find(received, BATTERY_RESPONSE_KEY);
if (tuple) {
memcpy(&g_battery_status, &tuple->value->data[0], sizeof(BatteryStatus));
set_battery(g_battery_status.state, g_battery_status.level);
}
}
示例9: rcv_arp
void
rcv_arp(void)
{
if ((ARP_P->hw_type != ARETH) || (ARP_P->protocol != ARIP))
goto leave;
if (ARP_P->his_proto_addr != tcpipcfg.c_myip) {
//rprintf("[ARP:NOT FOR ME]");
goto leave;
}
//rprintf("[ARP]");
//print_packet(ARP_P, 0);
switch (ARP_P->opcode) {
case ARREQ : // Incomming Request
statistics.arpInRequests++;
copy_hw_addr(ETH_P->destination, ARP_P->my_hw_addr);
ARP_P->his_proto_addr = ARP_P->my_proto_addr;
copy_hw_addr(ARP_P->his_hw_addr, ARP_P->my_hw_addr);
copy_hw_addr(ARP_P->my_hw_addr, ARP_STUB.my_hw_addr);
ARP_P->my_proto_addr = tcpipcfg.c_myip;
ARP_P->opcode = ARREP;
snd_packet(ARP_P, ARP_PLEN);
break;
case ARREP : { // Response for my ARP Request
struct TCB *tp;
int i;
//rprintf("[R_A-REP]");
for (tp = tcb, i = 0; i < num_socket; i++, tp++) {
if (!(IP_STUB(tp)->transport))
continue;
// Update All TCB's with matching IP address
if ((tp->status & TCB_ARP_ING) && (arp_target(tp) == ARP_P->my_proto_addr)) {
//rprintf("[ARP-OK %d]", i);
copy_hw_addr(ETH_STUB(tp)->destination, ARP_P->my_hw_addr);
if (tp->status & TCB_ARP_ING) {
tp->arp_retrytimer = 0; // Stop timer
tp->timeout_count = 0;
clr_status(tp, TCB_ARP_ING);
set_status(tp, TCB_ARP_ED);
statistics.arpInReplys++;
}
check_tcp_send(tp);
check_udp_send(tp);
}
}
break;
}
default :
break;
}
leave:
;
}
示例10: jfetch_initialize
int
jfetch_initialize(
jfetch_status *status,
const char *input,
bool is_file
)
{
int result = JFETCH_ERR_NONE;
TRACE_ENTRY();
if(!status) {
result = JFETCH_ERR_INVALID;
goto exit;
}
memset(status, 0, sizeof(jfetch_status));
if(!input) {
result = JFETCH_ERR_INVALID;
goto exit;
}
if(g_manager) {
result = jfetch_destroy(status);
if(JFETCH_FAILURE(result)) {
goto exit;
}
}
try {
g_library = json::acquire();
if(!g_library) {
result = JFETCH_ERR_UNINIT;
goto exit;
}
g_library->initialize(input, is_file);
g_manager = g_library->acquire_manager();
if(!g_manager) {
result = JFETCH_ERR_UNINIT;
goto exit;
}
} catch(std::runtime_error &exc) {
set_status(status, exc.what());
result = JFETCH_ERR_FAIL;
goto exit;
}
exit:
TRACE_EXIT("Return Value: 0x%x", result);
return result;
}
示例11: set_status_from_gdb
void set_status_from_gdb(const string& text)
{
if (private_gdb_input)
return;
if (!show_next_line_in_status && !text.contains(gdb->prompt(), -1))
return;
// Fetch line before prompt in GDB window
String s = XmTextGetString(gdb_w);
string message = s + messagePosition;
XtFree(s);
if (message.empty() && text.contains('\n'))
message = text;
if (show_next_line_in_status &&
(message.empty() || message[message.length() - 1] != '\n'))
return;
// Skip prompt and uncomplete lines
int idx = message.index('\n', -1);
if (idx >= 0)
message = message.before(idx);
strip_trailing_newlines(message);
if (message.empty() && text.contains('\n'))
message = text;
if (show_next_line_in_status)
{
messagePosition = XmTextGetLastPosition(gdb_w) + text.length();
show_next_line_in_status = false;
message.gsub('\n', ' ');
}
else
{
// Show first line only
while (!message.empty() && message[0] == '\n')
message = message.after('\n');
if (message.contains('\n'))
message = message.before('\n');
}
strip_trailing_newlines(message);
message.gsub('\t', ' ');
if (message.empty())
return;
// Don't log this stuff - it's already logged
bool old_log_status = log_status;
log_status = false;
set_status(message);
log_status = old_log_status;
}
示例12: mir_utf8encodeT
int __cdecl CYahooProto::SetAwayMsg( int status, const PROTOCHAR* msg )
{
char *c = msg && msg[0] ? mir_utf8encodeT(msg) : NULL;
debugLogA("[YahooSetAwayMessage] Status: %S, Msg: %s", pcli->pfnGetStatusModeDescription(status, 0), (char*)c);
if (!m_bLoggedIn) {
if (m_iStatus == ID_STATUS_OFFLINE) {
debugLogA("[YahooSetAwayMessage] WARNING: WE ARE OFFLINE!");
mir_free(c);
return 1;
} else {
if (m_startMsg) free(m_startMsg);
m_startMsg = c ? strdup(c) : NULL;
mir_free(c);
return 0;
}
}
/* need to tell ALL plugins that we are changing status */
BroadcastStatus(status);
if (m_startMsg) free(m_startMsg);
/* now decide what we tell the server */
if (c != 0) {
m_startMsg = strdup(c);
if (status == ID_STATUS_ONLINE) {
set_status(YAHOO_CUSTOM_STATUS, c, 0);
} else if (status != ID_STATUS_INVISIBLE) {
set_status(YAHOO_CUSTOM_STATUS, c, 1);
}
} else {
set_status(status, NULL, 0);
m_startMsg = NULL;
}
mir_free(c);
return 0;
}
示例13: lock
int PrefixInfo::set_read_write_status(uint64_t prefix, int status)
{
int err = 0;
tbsys::CWLock lock(&rw_lock_);
if (status == 0)
{
err = set_status(prefix, 0);
if (0 != err)
{
TBSYS_LOG(WARN, "failed to set status, prefix=%lu, err=%d", prefix, err);
}
}
else
{
lock.lock();
int ori_status = 0;
err = get_status(prefix, ori_status);
if (0 != err)
{
TBSYS_LOG(WARN, "failed to get ori status, prefix=%lu, err=%d", prefix, err);
}
else
{
if (ori_status != 0)
{
err = READ_WRITE_CONFLICT;
}
else
{
err = set_status(prefix, status);
if (0 != err)
{
TBSYS_LOG(WARN, "failed to set status, prefix=%lu, status=%d, err=%d", prefix, status, err);
}
}
}
lock.unlock();
}
return err;
}
示例14: Vehicle
/*- -------------------------------------------------------------- -*/
ResearchRobot::ResearchRobot(int id, int width, int height) : Vehicle(width, height) {
set_type('S');
set_num_id(id);
// setting the robot status
def_status = 50;
set_status(def_status);
// initially the robot hasn't deployed any flags
flagsDeployed = 0;
}
示例15: set_status
void CompassCalibrator::start(bool retry, float delay, uint16_t offset_max) {
if(running()) {
return;
}
_offset_max = offset_max;
_attempt = 1;
_retry = retry;
_delay_start_sec = delay;
_start_time_ms = AP_HAL::millis();
set_status(COMPASS_CAL_WAITING_TO_START);
}