-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProjectGuid>{B0A02F90-8B02-4F35-AFD7-6A7EABD14A91}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>Tizen.Telephony</RootNamespace>\r
- <AssemblyName>Tizen.Telephony</AssemblyName>\r
- <FileAlignment>512</FileAlignment>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\Net45\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <Prefer32Bit>false</Prefer32Bit>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\Net45\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <Prefer32Bit>false</Prefer32Bit>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>Tizen.Telephony.snk</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="Interop\Interop.Libraries.cs" />\r
- <Compile Include="Interop\Interop.Telephony.cs" />\r
- <Compile Include="Interop\Interop.Call.cs" />\r
- <Compile Include="Interop\Interop.Network.cs" />\r
- <Compile Include="Interop\Interop.Modem.cs" />\r
- <Compile Include="Interop\Interop.Sim.cs" />\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
- <Compile Include="Tizen.Telephony\CallHandle.cs" />\r
- <Compile Include="Tizen.Telephony\Call.cs" />\r
- <Compile Include="Tizen.Telephony\ChangeNotificationEventArgs.cs" />\r
- <Compile Include="Tizen.Telephony\ExceptionFactory.cs" />\r
- <Compile Include="Tizen.Telephony\Modem.cs" />\r
- <Compile Include="Tizen.Telephony\Network.cs" />\r
- <Compile Include="Tizen.Telephony\Sim.cs" />\r
- <Compile Include="Tizen.Telephony\SlotHandle.cs" />\r
- <Compile Include="Tizen.Telephony\StateEventArgs.cs" />\r
- <Compile Include="Tizen.Telephony\Telephony.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="Tizen.Telephony.nuspec" />\r
- <None Include="Tizen.Telephony.Net45.project.json" />\r
- <None Include="Tizen.Telephony.snk" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{E87B20AE-B752-4E64-9517-4827AC42A33A}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Tizen.Telephony</RootNamespace>
+ <AssemblyName>Tizen.Telephony</AssemblyName>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\Net45\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\Net45\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <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" />
+ <Compile Include="Interop\Interop.Network.cs" />
+ <Compile Include="Interop\Interop.Modem.cs" />
+ <Compile Include="Interop\Interop.Sim.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Tizen.Telephony\CallHandle.cs" />
+ <Compile Include="Tizen.Telephony\Call.cs" />
+ <Compile Include="Tizen.Telephony\ChangeNotificationEventArgs.cs" />
+ <Compile Include="Tizen.Telephony\ExceptionFactory.cs" />
+ <Compile Include="Tizen.Telephony\Modem.cs" />
+ <Compile Include="Tizen.Telephony\Network.cs" />
+ <Compile Include="Tizen.Telephony\Sim.cs" />
+ <Compile Include="Tizen.Telephony\SlotHandle.cs" />
+ <Compile Include="Tizen.Telephony\StateEventArgs.cs" />
+ <Compile Include="Tizen.Telephony\Telephony.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Tizen.Telephony.nuspec" />
+ <None Include="Tizen.Telephony.Net45.project.json" />
+ <None Include="Tizen.Telephony.snk" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
- -->\r
+ -->
</Project>
\ No newline at end of file
<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="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
/// </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);
- return _list;
+ throw ExceptionFactory.CreateException(error);
}
_callHandle.Clear();
- IntPtr[] handleArray = new IntPtr[count];
- Marshal.Copy(_callList, handleArray, 0, (int)count);
- foreach (IntPtr handle in handleArray)
+ if (count > 0)
{
- CallHandle info = new CallHandle(handle);
- _list.Add(info);
- }
+ 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);
+ _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;
+ public Notification NotificationType
+ {
+ get;
+ internal set;
+ }
/// <summary>
/// Data as per the Notification type
/// </summary>
- public object notificationData;
-
- internal ChangeNotificationEventArgs(Notification noti, object data)
+ public object NotificationData
{
- notificationType = noti;
- notificationData = data;
+ get;
+ internal set;
}
}
}
/// </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;
-
- internal StateEventArgs(State s)
+ public State CurrentState
{
- currentState = s;
+ get;
+ internal set;
}
}
}
/// </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;
}
}