<AssemblyOriginatorKeyFile>Tizen.Telephony.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Net.Http" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
<Compile Include="Interop\Interop.Libraries.cs" />
<Compile Include="Interop\Interop.Telephony.cs" />
<Compile Include="Interop\Interop.Call.cs" />
<None Include="Tizen.Telephony.project.json" />
<None Include="Tizen.Telephony.snk" />
</ItemGroup>
- <ItemGroup />
- <ItemGroup>
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
- </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Tizen\Tizen.CSharp.GBS.targets" Condition="Exists('$(MSBuildExtensionsPath)\Tizen\Tizen.CSharp.GBS.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
/// </summary>
public class Call
{
- internal IntPtr _handle;
- private List<IntPtr> _callHandle = new List<IntPtr>();
- private List<CallHandle> _list = new List<CallHandle>();
- private IntPtr _callList;
- private Interop.Call.SafeCallList _safeCallList;
-
/// <summary>
/// Public Constructor
/// </summary>
/// <param name="handle">
/// SlotHandle received in the Manager.Init API
/// </param>
- /// <exception cref="ArgumentNullException">
- /// This exception occurs if handle provided is null
- /// </exception>
public Call(SlotHandle handle)
{
- if (handle == null)
- {
- throw new ArgumentNullException();
- }
-
_handle = handle._handle;
}
/// <returns>
/// List of CallHandle for existing calls.
/// </returns>
- /// <exception cref="InvalidOperationException">
- /// This exception can occur due to one of the following reasons:
- /// 1. Permission Denied
- /// 2. Not Supported
- /// 3. Operation Failed
- /// </exception>
public List<CallHandle> GetCallHandleList()
{
uint count;
if (error != TelephonyError.None)
{
Tizen.Log.Error(Interop.Telephony.LogTag, "GetCallList Failed with error " + error);
- throw ExceptionFactory.CreateException(error);
+ return _list;
}
_callHandle.Clear();
- if (count > 0)
+ IntPtr[] handleArray = new IntPtr[count];
+ Marshal.Copy(_callList, handleArray, 0, (int)count);
+ foreach (IntPtr handle in handleArray)
{
- IntPtr[] handleArray = new IntPtr[count];
- Marshal.Copy(_callList, handleArray, 0, (int)count);
- foreach (IntPtr handle in handleArray)
- {
- CallHandle info = new CallHandle(handle);
- _list.Add(info);
- }
-
- _safeCallList = new Interop.Call.SafeCallList(_callList, count);
+ CallHandle info = new CallHandle(handle);
+ _list.Add(info);
}
+
+ _safeCallList = new Interop.Call.SafeCallList(_callList, count);
return _list;
}
+
+ internal IntPtr _handle;
+ private List<IntPtr> _callHandle = new List<IntPtr>();
+ private List<CallHandle> _list = new List<CallHandle>();
+ private IntPtr _callList;
+ private Interop.Call.SafeCallList _safeCallList;
}
}
/// </summary>
public class CallHandle
{
- private IntPtr _callHandle;
-
/// <summary>
/// Enumeration for the call status.
/// </summary>
{
_callHandle = handle;
}
+
+ private IntPtr _callHandle;
}
}
/// </summary>
public class ChangeNotificationEventArgs : EventArgs
{
- internal ChangeNotificationEventArgs(Notification noti, object data)
- {
- NotificationType = noti;
- NotificationData = data;
- }
-
/// <summary>
/// Enumeration for Telephony notification.
/// </summary>
/// <summary>
/// Telephony notification type
/// </summary>
- public Notification NotificationType
- {
- get;
- internal set;
- }
+ public Notification notificationType;
/// <summary>
/// Data as per the Notification type
/// </summary>
- public object NotificationData
+ public object notificationData;
+
+ internal ChangeNotificationEventArgs(Notification noti, object data)
{
- get;
- internal set;
+ notificationType = noti;
+ notificationData = data;
}
}
}
/// </summary>
public class Modem
{
- internal IntPtr _handle;
-
/// <summary>
/// Modem Class Constructor
/// </summary>
/// <param name="handle">
/// SlotHandle received in the Manager.Init API
/// </param>
- /// <exception cref="ArgumentNullException">
- /// This exception occurs if handle provided is null
- /// </exception>
public Modem(SlotHandle handle)
{
- if (handle == null)
- {
- throw new ArgumentNullException();
- }
-
_handle = handle._handle;
}
}
}
+
+ internal IntPtr _handle;
}
}
/// </summary>
public class Network
{
- internal IntPtr _handle;
-
- /// <summary>
- /// Network Class Constructor
- /// </summary>
- /// <param name="handle">
- /// SlotHandle received in the Manager.Init API
- /// </param>
- /// <exception cref="ArgumentNullException">
- /// This exception occurs if handle provided is null
- /// </exception>
- public Network(SlotHandle handle)
- {
- if (handle == null)
- {
- throw new ArgumentNullException();
- }
-
- _handle = handle._handle;
- }
-
/// <summary>
/// Enumeration for RSSI (Receive Signal Strength Indicator).
/// Rssi6 indicates the highest strength.
}
/// <summary>
+ /// Network Class Constructor
+ /// </summary>
+ /// <param name="handle">
+ /// SlotHandle received in the Manager.Init API
+ /// </param>
+ public Network(SlotHandle handle)
+ {
+ _handle = handle._handle;
+ }
+
+ /// <summary>
/// Gets the LAC (Location Area Code) of the current location.
/// </summary>
/// <priviledge>
return baseStationLongitude;
}
}
+
+ internal IntPtr _handle;
}
}
/// </summary>
public class Sim
{
- internal IntPtr _handle;
-
- /// <summary>
- /// Sim Class Constructor
- /// </summary>
- /// <param name="handle">
- /// SlotHandle received in the Manager.Init API
- /// </param>
- /// <exception cref="ArgumentNullException">
- /// This exception occurs if handle provided is null
- /// </exception>
- public Sim(SlotHandle handle)
- {
- if (handle == null)
- {
- throw new ArgumentNullException();
- }
-
- _handle = handle._handle;
- }
-
/// <summary>
/// Enumeration for the state of SIM card.
/// </summary>
}
/// <summary>
+ /// Sim Class Constructor
+ /// </summary>
+ /// <param name="handle">
+ /// SlotHandle received in the Manager.Init API
+ /// </param>
+ public Sim(SlotHandle handle)
+ {
+ _handle = handle._handle;
+ }
+
+ /// <summary>
/// Gets the Integrated Circuit Card IDentification (ICC-ID).
/// The Integrated Circuit Card Identification number internationally identifies SIM cards.
/// </summary>
return callForwardingIndicatorState;
}
}
+
+ internal IntPtr _handle;
}
}
{
public class SlotHandle
{
- internal IntPtr _handle;
- private List<Interop.Telephony.NotificationCallback> _changeNotificationList = new List<Interop.Telephony.NotificationCallback>();
-
- internal SlotHandle(IntPtr handle)
- {
- _handle = handle;
- }
-
/// <summary>
/// Event Handler for Receiving the Telephony State Changes
/// this event will be triggered for the NotificationId's given in the SetNotificationId API
/// </summary>
public event EventHandler<ChangeNotificationEventArgs> ChangeNotification;
- internal IntPtr Handle
- {
- get
- {
- return _handle;
- }
- }
-
/// <summary>
/// The Notification Id's for which the ChangeNotification event will be triggered
/// </summary>
}
}
+ internal SlotHandle(IntPtr handle)
+ {
+ _handle = handle;
+ }
+
+ internal IntPtr Handle
+ {
+ get
+ {
+ return _handle;
+ }
+ }
+
+ internal IntPtr _handle;
private void SetCallback(ChangeNotificationEventArgs.Notification n)
{
Interop.Telephony.NotificationCallback NotificationDelegate = (IntPtr handle, ChangeNotificationEventArgs.Notification notiId, IntPtr data, IntPtr userData) =>
throw e;
}
}
+
+ private List<Interop.Telephony.NotificationCallback> _changeNotificationList = new List<Interop.Telephony.NotificationCallback>();
}
}
/// </summary>
public class StateEventArgs : EventArgs
{
- internal StateEventArgs(State s)
- {
- CurrentState = s;
- }
-
/// <summary>
/// The Current State
/// </summary>
- public State CurrentState
+ public State currentState;
+
+ internal StateEventArgs(State s)
{
- get;
- internal set;
+ currentState = s;
}
}
}
/// </summary>
public static class Manager
{
- internal static List<SlotHandle> _telephonyHandle = new List<SlotHandle>();
- private static HandleList _handleList;
- private static bool _isInitialized = false;
- private static event EventHandler<StateEventArgs> _stateChanged;
- private static StateChangedCallback stateDelegate = delegate(State state, IntPtr userData)
- {
- StateEventArgs args = new StateEventArgs(state);
- _stateChanged?.Invoke(null, args);
- };
-
/// <summary>
/// Event Handler to be invoked when the telephony state changes.
/// </summary>
}
/// <summary>
- /// Acquires the telephony state value.
- /// </summary>
- /// <returns>
- /// The state value of telephony.
- /// </returns>
- public static State CurrentState
- {
- get
- {
- State state = State.NotReady;
- TelephonyError error = Interop.Telephony.TelephonyGetState(out state);
- if (error != TelephonyError.None)
- {
- Tizen.Log.Error(Interop.Telephony.LogTag, "GetState Failed with Error " + error);
- return State.Unavailable;
- }
-
- return state;
- }
- }
-
- /// <summary>
/// Acquires the Number of available handles to use the telephony API.
/// </summary>
/// <returns>
}
_isInitialized = true;
- //Tizen.Log.Info(Interop.Telephony.LogTag, "Returning the number of sims " + _handleList.Count);
+ Tizen.Log.Info(Interop.Telephony.LogTag, "Returning the number of sims " + _handleList.Count);
return _telephonyHandle;
}
_telephonyHandle.Clear();
}
+ /// <summary>
+ /// Acquires the telephony state value.
+ /// </summary>
+ /// <returns>
+ /// The state value of telephony.
+ /// </returns>
+ public static State CurrentState
+ {
+ get
+ {
+ State state = State.NotReady;
+ TelephonyError error = Interop.Telephony.TelephonyGetState(out state);
+ if (error != TelephonyError.None)
+ {
+ Tizen.Log.Error(Interop.Telephony.LogTag, "GetState Failed with Error " + error);
+ return State.Unavailable;
+ }
+
+ return state;
+ }
+ }
+
internal static SlotHandle FindHandle(IntPtr handle)
{
SlotHandle temp = _telephonyHandle[0];
return temp;
}
+
+ internal static List<SlotHandle> _telephonyHandle = new List<SlotHandle>();
+
+ private static StateChangedCallback stateDelegate = delegate(State state, IntPtr userData)
+ {
+ StateEventArgs args = new StateEventArgs(state);
+ _stateChanged?.Invoke(null, args);
+ };
+ private static HandleList _handleList;
+ private static bool _isInitialized = false;
+ private static event EventHandler<StateEventArgs> _stateChanged;
}
}