4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
21 #ifndef __TCORE_CO_PS_H__
22 #define __TCORE_CO_PS_H__
24 #include <core_object.h>
25 #include <co_context.h>
32 struct tcore_ps_operations {
33 TReturn (*define_context)(CoreObject *co_ps, CoreObject *context, void *user_data);
34 TReturn (*activate_context)(CoreObject *co_ps, CoreObject *context, void *user_data);
35 TReturn (*deactivate_context)(CoreObject *co_ps, CoreObject *context, void *user_data);
38 CoreObject* tcore_ps_new(TcorePlugin *p, const char *name, struct tcore_ps_operations *ops, TcoreHal *hal);
39 void tcore_ps_free(CoreObject *o);
41 void tcore_ps_set_ops(CoreObject *o, struct tcore_ps_operations *ops);
43 TReturn tcore_ps_add_context(CoreObject *o, CoreObject *ctx_o);
44 TReturn tcore_ps_remove_context(CoreObject *o, CoreObject *ctx_o);
45 CoreObject* tcore_ps_ref_context_by_role(CoreObject *o, enum co_context_role role);
46 GSList* tcore_ps_ref_context_by_id(CoreObject *o, unsigned int id);
47 gboolean tcore_ps_any_context_activating_activated(CoreObject *o, int * state);
49 TReturn tcore_ps_set_online(CoreObject *o, gboolean state);
50 TReturn tcore_ps_set_num_of_pdn(CoreObject *o, gint numbers);
51 unsigned int tcore_ps_get_num_of_pdn(CoreObject *o);
52 unsigned int tcore_ps_set_cid_active(CoreObject *o, unsigned int cid, unsigned int enable);
53 unsigned int tcore_ps_get_cid_active(CoreObject *o, unsigned int cid);
54 GSList* tcore_ps_get_active_cids(CoreObject *o);
55 unsigned int tcore_ps_set_cid_connected(CoreObject *o, unsigned int cid, unsigned int connected);
56 unsigned int tcore_ps_get_cid_connected(CoreObject *o, unsigned int cid);
57 GSList* tcore_ps_get_connected_cids(CoreObject *o);
58 unsigned int tcore_ps_is_active_apn(CoreObject *o, const char* apn);
59 TReturn tcore_ps_assign_context_id(CoreObject *o, CoreObject *context, unsigned char cid);
60 TReturn tcore_ps_clear_context_id(CoreObject *o, CoreObject *context);
62 TReturn tcore_ps_define_context(CoreObject *o, CoreObject *context, void *user_data);
63 TReturn tcore_ps_activate_context(CoreObject *o, CoreObject *context, void *user_data);
64 TReturn tcore_ps_deactivate_context(CoreObject *o, CoreObject *context, void *user_data);
65 TReturn tcore_ps_deactivate_contexts(CoreObject *o);
66 TReturn tcore_ps_deactivate_cid(CoreObject *o, unsigned int cid);