static void rpmb_access_end(void)
{
	start_queue(BOOT1_DEV_NODE);
	start_queue(BOOT0_DEV_NODE);
	start_queue(MAIN_DEV_NODE);

	mutex_unlock(&rpmb_mutex);
}
Пример #2
0
void QContentHubServer::dispatch(msgpack::rpc::request req) {
    try {
        std::string method;
        req.method().convert(&method);

        if(method == "push") {
            msgpack::type::tuple<std::string, std::string> params;
            req.params().convert(&params);
            push_queue(req, params.get<0>(), params.get<1>());
        } else if(method == "pop") {
            msgpack::type::tuple<std::string> params;
            req.params().convert(&params);
            pop_queue(req, params.get<0>());
        } else if(method == "push_nowait") {
            msgpack::type::tuple<std::string, std::string> params;
            req.params().convert(&params);
            push_queue_nowait(req, params.get<0>(), params.get<1>());
        } else if(method == "pop_nowait") {
            msgpack::type::tuple<std::string> params;
            req.params().convert(&params);
            pop_queue_nowait(req, params.get<0>());
        } else if(method == "add") {
            msgpack::type::tuple<std::string, int> params;
            req.params().convert(&params);
            add_queue(req, params.get<0>(), params.get<1>());
        /*
        } else if(method == "del") {
            msgpack::type::tuple<std::string> params;
            req.params().convert(&params);
            del_queue(req, params.get<0>());
        } else if(method == "fdel") {
            msgpack::type::tuple<std::string> params;
            req.params().convert(&params);
            force_del_queue(req, params.get<0>());
        */
        } else if(method == "set_capacity") {
            msgpack::type::tuple<std::string, int> params;
            req.params().convert(&params);
            set_queue_capacity(req, params.get<0>(), params.get<1>());
        } else if(method == "start") {
            msgpack::type::tuple<std::string> params;
            req.params().convert(&params);
            start_queue(req, params.get<0>());
        } else if(method == "stop") {
            msgpack::type::tuple<std::string> params;
            req.params().convert(&params);
            stop_queue(req, params.get<0>());
        } else if(method == "clear") {
            msgpack::type::tuple<std::string> params;
            req.params().convert(&params);
            clear_queue(req, params.get<0>());
        } else if(method == "stats") {
            stats(req);
        } else if(method == "stat_queue") {
            msgpack::type::tuple<std::string> params;
            req.params().convert(&params);
            stat_queue(req, params.get<0>());
        } else {
            req.error(msgpack::rpc::NO_METHOD_ERROR);
        }
    } catch (msgpack::type_error& e) {
        req.error(msgpack::rpc::ARGUMENT_ERROR);
        return;

    } catch (std::exception& e) {
        req.error(std::string(e.what()));
        return;
    }
}