+++ /dev/null
-using System;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-using System.Linq;
-using Xamarin.Forms;
-using Tizen;
-using Tizen.CallManager;
-
-namespace XamarinForTizen.Tizen
-{
- public class MainPage : ContentPage
- {
- public MainPage()
- {
- var initBtn = new Button
- {
- Text = "Initialize",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- initBtn.Clicked += initBtn_Clicked;
-
- var dialBtn = new Button
- {
- Text = "Dial & end voice call",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- dialBtn.Clicked += dialBtn_Clicked;
-
- var holdBtn = new Button
- {
- Text = "Hold & unhold voice call",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- holdBtn.Clicked += holdBtn_Clicked;
-
- var answerBtn = new Button
- {
- Text = "Answer incoming call",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- answerBtn.Clicked += answerBtn_Clicked;
-
- var alertBtn = new Button
- {
- Text = "Start & Stop alert",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- alertBtn.Clicked += alertBtn_Clicked;
-
- var rejectBtn = new Button
- {
- Text = "Reject incoming call",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- rejectBtn.Clicked += rejectBtn_Clicked;
-
- var swapBtn = new Button
- {
- Text = "Swap call",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- swapBtn.Clicked += swapBtn_Clicked;
-
- var joinBtn = new Button
- {
- Text = "Join calls",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- joinBtn.Clicked += joinBtn_Clicked;
-
- var splitBtn = new Button
- {
- Text = "Split call",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- splitBtn.Clicked += splitBtn_Clicked;
-
- var getAllCallListBtn = new Button
- {
- Text = "Get all call list",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getAllCallListBtn.Clicked += getAllCallListBtn_Clicked;
-
- var getConfCallListBtn = new Button
- {
- Text = "Get conf call list",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getConfCallListBtn.Clicked += getConfCallListBtn_Clicked;
-
- var getCallDataBtn = new Button
- {
- Text = "Get all call data",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getCallDataBtn.Clicked += getCallDataBtn_Clicked;
-
- var statusBtn = new Button
- {
- Text = "Get call status",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- statusBtn.Clicked += statusBtn_Clicked;
-
- var deinitBtn = new Button
- {
- Text = "Deinitialize",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- deinitBtn.Clicked += deinitBtn_Clicked;
-
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- initBtn, dialBtn, holdBtn, answerBtn, alertBtn, rejectBtn, swapBtn, joinBtn, splitBtn,
- getAllCallListBtn, getConfCallListBtn, getCallDataBtn, statusBtn, deinitBtn
- }
- };
- }
-
- private void getCallDataBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.cmHandle.GetAllCallData(out CallData incoming, out CallData active, out CallData held);
- if (incoming == null)
- {
- Log.Debug(Globals.LogTag, "No incoming call");
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "Incoming call Id: " + incoming.Id);
- Log.Debug(Globals.LogTag, "Incoming call number: " + incoming.CallNumber);
- }
-
- if (active == null)
- {
- Log.Debug(Globals.LogTag, "No active calls");
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "Active call Id: " + active.Id);
- Log.Debug(Globals.LogTag, "Active call number: " + active.CallNumber);
- }
-
- if (held == null)
- {
- Log.Debug(Globals.LogTag, "No held calls");
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "Held call Id: " + held.Id);
- Log.Debug(Globals.LogTag, "Held call number: " + held.CallNumber);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Get all call data exception: " + ex.ToString());
- }
- }
-
- private void getConfCallListBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- List<ConferenceCallData> confCallList = Globals.cmHandle.AllConferenceCalls.ToList();
- if (confCallList.Count == 0)
- {
- Log.Debug(Globals.LogTag, "Conf call list is empty");
- return;
- }
-
- for (int i = 0; i < confCallList.Count; i++)
- {
- Log.Debug(Globals.LogTag, "ID[" + i + "]: " + confCallList[i].Id);
- Log.Debug(Globals.LogTag, "Number[" + i + "]: " + confCallList[i].CallNumber);
- Log.Debug(Globals.LogTag, "PersonId[" + i + "]: " + confCallList[i].PersonId);
- Log.Debug(Globals.LogTag, "Mode[" + i + "]: " + confCallList[i].Mode);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Get all conf call list exception: " + ex.ToString());
- }
- }
-
- private void getAllCallListBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- List<CallData> callDataList = Globals.cmHandle.AllCalls.ToList();
- if (callDataList.Count == 0)
- {
- Log.Debug(Globals.LogTag, "Call data list is empty");
- return;
- }
-
- for (int i = 0; i < callDataList.Count; i++)
- {
- Log.Debug(Globals.LogTag, "Call ID[" + i +"]: " + callDataList[i].Id);
- Log.Debug(Globals.LogTag, "Number[" + i + "]: " + callDataList[i].CallNumber);
- Log.Debug(Globals.LogTag, "Call direction[" + i + "]: " + callDataList[i].Direction);
- Log.Debug(Globals.LogTag, "Name[" + i + "]: " + callDataList[i].CallingName);
- Log.Debug(Globals.LogTag, "Call type[" + i + "]: " + callDataList[i].Type);
- Log.Debug(Globals.LogTag, "Call state[" + i + "]: " + callDataList[i].State);
- Log.Debug(Globals.LogTag, "Member count[" + i + "]: " + callDataList[i].MemberCount);
- Log.Debug(Globals.LogTag, "Is Ecc[" + i + "]: " + callDataList[i].IsEmergency);
- Log.Debug(Globals.LogTag, "Call domain[" + i + "]: " + callDataList[i].Domain);
- Log.Debug(Globals.LogTag, "Start time[" + i + "]: " + callDataList[i].StartTime);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Get all call list exception: " + ex.ToString());
- }
- }
-
- private void splitBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.cmHandle.SplitCall(1);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Split call exception: " + ex.ToString());
- }
- }
-
- private void joinBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.cmHandle.JoinCall();
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Join call exception: " + ex.ToString());
- }
- }
-
- private void swapBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.cmHandle.SwapCall();
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Swap call exception: " + ex.ToString());
- }
- }
-
- private void statusBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Log.Debug(Globals.LogTag, "Call status: " + Globals.cmHandle.CallStatus);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Get call status exception: " + ex.ToString());
- }
- }
-
- private void rejectBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.cmHandle.RejectCall();
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Reject call exception: " + ex.ToString());
- }
- }
-
- private async void alertBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.cmHandle.CallStatusChanged += CmHandle_CallStatusChanged;
- Globals.cmHandle.StopAlert();
- await Task.Delay(5000);
- Globals.cmHandle.StartAlert();
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Call alert exception: " + ex.ToString());
- }
- }
-
- private void CmHandle_CallStatusChanged(object sender, CallStatusChangedEventArgs e)
- {
- Log.Debug(Globals.LogTag, "Call status changed: " + e.CallNumber + e.Status);
- }
-
- private void answerBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.cmHandle.AnswerCall(CallAnswerType.Normal);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Answer call exception: " + ex.ToString());
- }
- }
-
- private async void holdBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.HoldTest = true;
- Globals.cmHandle.DialCall(Globals.Number, CallType.Voice, MultiSimSlot.Default);
- await Task.Delay(20000);
- Globals.cmHandle.HoldCall();
- await Task.Delay(8000);
- Globals.cmHandle.UnholdCall();
- await Task.Delay(8000);
- Globals.cmHandle.EndCall(1, CallReleaseType.AllActiveCalls);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Hold call exception: " + ex.ToString());
- }
- }
-
- private async void dialBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- Globals.cmHandle.DialCall(Globals.Number, CallType.Voice, MultiSimSlot.Default);
- await Task.Delay(20000);
- Globals.cmHandle.EndCall(1, CallReleaseType.AllCalls);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Dial call exception: " + ex.ToString());
- }
- }
-
- private void deinitBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle == null)
- {
- Log.Debug(Globals.LogTag, "Not initialized!!!!!");
- return;
- }
-
- CallManager.DeinitCm(Globals.cmHandle);
- Globals.cmHandle = null;
- Log.Debug(Globals.LogTag, "Callmanager deinitialized successfully");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Callmanager deinit exception: " + ex.ToString());
- }
- }
-
- private void initBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.cmHandle != null)
- {
- Log.Debug(Globals.LogTag, "Already initialized!!!!!");
- return;
- }
-
- Globals.cmHandle = CallManager.InitCm();
- Globals.cmHandle.EnableRecovery("Tizen.CallManager.Test");
- Log.Debug(Globals.LogTag, "Callmanager initialization is successful");
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Callmanager init exception: " + ex.ToString());
- }
- }
-
- private async void CmHandle_CallEventChangedAsync(object sender, CallEventEventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Call event changed handler, CallEvent: " + e.Event);
- if (e.EventData != null)
- {
- Log.Debug(Globals.LogTag, "Call ID: " + e.EventData.Id);
- Log.Debug(Globals.LogTag, "Sim slot: " + e.EventData.SimSlot);
- Log.Debug(Globals.LogTag, "Call end cause: " + e.EventData.EndCause);
- }
-
- if (Globals.DialTest && e.Event == CallEvent.Active)
- {
- Globals.DialTest = false;
- await Task.Delay(3000);
- Globals.cmHandle.EndCall(e.EventData.Id, CallReleaseType.ByCallHandle);
- }
-
- if (Globals.HoldTest && e.Event == CallEvent.Active)
- {
- await Task.Delay(3000);
- Globals.cmHandle.HoldCall();
- }
-
- if (Globals.HoldTest && e.Event == CallEvent.Held)
- {
- Globals.HoldTest = false;
- await Task.Delay(8000);
- Globals.cmHandle.UnholdCall();
- await Task.Delay(8000);
- Globals.cmHandle.EndCall(e.EventData.Id, CallReleaseType.AllActiveCalls);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "End call exception: " + ex.ToString());
- }
- }
-
- ~MainPage()
- {
- if (Globals.cmHandle != null)
- {
- CallManager.DeinitCm(Globals.cmHandle);
- Globals.cmHandle = null;
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-using Xamarin.Forms;
-using Tizen;
-using Tizen.System;
-using Tizen.CallManager;
-
-namespace XamarinForTizen.Tizen
-{
- internal static class Globals
- {
- internal static string LogTag = "CallManagerTest";
- internal static CmClientHandle cmHandle = null;
- internal static string Number = "9900816947";
- internal static bool DialTest = false;
- internal static bool HoldTest = false;
- }
- public class App : Application
- {
- private static bool s_isTelephonySupported = false;
- public App()
- {
- SystemInfo.TryGetValue("http://tizen.org/feature/network.telephony", out s_isTelephonySupported);
- if (s_isTelephonySupported)
- {
- Log.Debug(Globals.LogTag, "Telephony feature check = " + s_isTelephonySupported);
- MainPage = new NavigationPage(new MainPage());
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "Telephony feature is not supported");
- }
- }
-
- protected override void OnStart()
- {
- // Handle when your app starts
- }
-
- protected override void OnSleep()
- {
- // Handle when your app sleeps
- }
-
- protected override void OnResume()
- {
- // Handle when your app resumes
- }
- }
-
- class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
- {
- private static App _app;
- protected override void OnCreate()
- {
- base.OnCreate();
-
- Log.Debug(Globals.LogTag, "OnCreate()");
- _app = new App();
- LoadApplication(_app);
- }
-
- public static App getApp()
- {
- return _app;
- }
- static void Main(string[] args)
- {
- var app = new Program();
- global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
- app.Run(args);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<Project>
- <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
-
- <PropertyGroup Label="Globals">
- <TizenProjectExtensionsPath>$(MSBuildExtensionsPath)\Tizen\VisualStudio\</TizenProjectExtensionsPath>
- </PropertyGroup>
-
- <Import Project="$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.props" Condition="Exists('$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.props')" />
-
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>netcoreapp1.1</TargetFramework>
- </PropertyGroup>
-
- <!-- Property Group for Tizen Project -->
- <PropertyGroup>
- <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>
- <PackageTargetFallback>$(PackageTargetFallback);portable-net45+wp80+win81+wpa81</PackageTargetFallback>
- </PropertyGroup>
-
- <!--
- This Property Group for msbuild command line.
- If project build on Visual Studio, it would be set automatically through the certificate manager.
- <PropertyGroup>
- <AuthorPath>author_test.p12</AuthorPath>
- <AuthorPass>author_test</AuthorPass>
- <DistributorPath>tizen-distributor-signer.p12</DistributorPath>
- <DistributorPass>tizenpkcs12passfordsigner</DistributorPass>
- </PropertyGroup>
- -->
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>portable</DebugType>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>None</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <Folder Include="lib\" />
- <Folder Include="res\" />
- </ItemGroup>
-
- <ItemGroup>
- <PackageReference Include="Tizen.NET.Sdk" Version="0.9.18-pre1" />
- <PackageReference Include="Xamarin.Forms" Version="2.4.0.275-pre3" />
- <PackageReference Include="Xamarin.Forms.Platform.Tizen" Version="2.3.5-r256-001" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="..\..\src\Tizen.CallManager\Tizen.CallManager.csproj" />
- </ItemGroup>
-
- <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
- <Import Project="$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.targets" Condition="Exists('$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.targets')" />
-
- <!-- Install Check 'Visual Studio for Tizen' for developing on Visual Studio -->
- <Target Name="TizenVsixInstallCheck" BeforeTargets="CompileDesignTime">
- <Warning Condition="!Exists('$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.props')" Text="$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.props is not exist.
 you need to check if 'Visual Studio for Tizen' is installed" />
- <Warning Condition="!Exists('$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.targets')" Text="$(TizenProjectExtensionsPath)Tizen.NET.ProjectType.targets is not exist.\
 you need to check if 'Visual Studio for Tizen' is installed" />
- </Target>
-</Project>
-
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26430.13
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.CallManager.Test", "Tizen.CallManager.Test.csproj", "{404DDD6F-0734-4F16-A70F-EB384C247669}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.CallManager", "..\..\src\Tizen.CallManager\Tizen.CallManager.csproj", "{4067DC7E-6F41-415B-950A-934CC0CEAFE5}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {404DDD6F-0734-4F16-A70F-EB384C247669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {404DDD6F-0734-4F16-A70F-EB384C247669}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {404DDD6F-0734-4F16-A70F-EB384C247669}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {404DDD6F-0734-4F16-A70F-EB384C247669}.Release|Any CPU.Build.0 = Release|Any CPU
- {4067DC7E-6F41-415B-950A-934CC0CEAFE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4067DC7E-6F41-415B-950A-934CC0CEAFE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4067DC7E-6F41-415B-950A-934CC0CEAFE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4067DC7E-6F41-415B-950A-934CC0CEAFE5}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="4" package="Tizen.CallManager.Test" version="1.0.0">
- <profile name="common" />
- <ui-application appid="org.tizen.example.Tizen.CallManager.Test"
- exec="Tizen.CallManager.Test.dll"
- type="dotnet"
- multiple="false"
- taskmanage="true"
- nodisplay="false"
- launch_mode="single">
- <label>Tizen.CallManager.Test</label>
- <icon>Tizen.CallManager.Test.png</icon>
- </ui-application>
-</manifest>
+++ /dev/null
-using System;
-using Xamarin.Forms;
-using Tizen;
-using Tizen.Tapi;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace XamarinForTizen.Tizen
-{
- public class CallPage : ContentPage
- {
- Call call = null;
- uint incomingCallHandle = 0;
- uint activeCallHandle = 0;
- uint heldCallHandle = 0;
- Entry entry;
- string num;
-
- Notification[] arrNoti = { Notification.NetworkDefaultSubscription, Notification.IdleVoiceCall , Notification.ActiveVoiceCall, Notification.HeldVoiceCall, Notification.DialingVoiceCall,
- Notification.AlertVoiceCall, Notification.IncomingVoiceCall, Notification.HeldCallInfo, Notification.ActiveCallInfo,
- Notification.JoinedCallInfo, Notification.CallSoundRingbackTone, Notification.CallSoundWbamr, Notification.CallSoundPath, Notification.CallPreferredVoiceSubscription};
- public CallPage()
- {
- try
- {
- call = new Call(Globals.handleModem0);
- RegisterNotiCallEvents(Globals.handleModem0);
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Call constructor throws exception = " + ex.ToString());
- }
-
- var dialCallBtn = new Button
- {
- Text = "DialCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- dialCallBtn.Clicked += DialCallBtn_Clicked;
-
- var ansCallBtn = new Button
- {
- Text = "AnswerCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- ansCallBtn.Clicked += AnsCallBtn_Clicked;
-
- var endCallBtn = new Button
- {
- Text = "EndCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- endCallBtn.Clicked += EndCallBtn_Clicked;
-
- var holdCallBtn = new Button
- {
- Text = "HoldCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- holdCallBtn.Clicked += HoldCallBtn_Clicked;
-
- var activeCallBtn = new Button
- {
- Text = "ActiveCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- activeCallBtn.Clicked += ActiveCallBtn_Clicked;
-
- var swapCallBtn = new Button
- {
- Text = "SwapCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- swapCallBtn.Clicked += SwapCallBtn_Clicked;
-
- var joinCallBtn = new Button
- {
- Text = "JoinCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- joinCallBtn.Clicked += JoinCallBtn_Clicked;
-
- var splitCallBtn = new Button
- {
- Text = "SplitCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- splitCallBtn.Clicked += SplitCallBtn_Clicked;
-
- var transferCallBtn = new Button
- {
- Text = "TransferCall",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- transferCallBtn.Clicked += TransferCallBtn_Clicked;
-
- var setMuteStBtn = new Button
- {
- Text = "SetCallMuteStatus",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- setMuteStBtn.Clicked += SetMuteStBtn_Clicked;
-
- var getMuteStBtn = new Button
- {
- Text = "GetCallMuteStatus",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getMuteStBtn.Clicked += GetMuteStBtn_Clicked;
-
- var setVolumeInfoBtn = new Button
- {
- Text = "SetCallVolumeInfo",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- setVolumeInfoBtn.Clicked += SetVolumeInfoBtn_Clicked;
-
- var getVolumeInfoBtn = new Button
- {
- Text = "GetCallVolumeInfo",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getVolumeInfoBtn.Clicked += GetVolumeInfoBtn_Clicked;
-
- var setSoundPathBtn = new Button
- {
- Text = "SetCallSoundPath",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- setSoundPathBtn.Clicked += SetSoundPathBtn_Clicked;
-
- var getCallBtn = new Button
- {
- Text = "GetCallStatus",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getCallBtn.Clicked += GetCallBtn_Clicked;
-
- var getAllCallBtn = new Button
- {
- Text = "GetAllCallStatus",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getAllCallBtn.Clicked += GetAllCallBtn_Clicked;
-
- var startstopContDtmfBtn = new Button
- {
- Text = "StartStopContDtmf",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- startstopContDtmfBtn.Clicked += StartStopContDtmfBtn_Clicked;
-
- var sendBurstDtmfBtn = new Button
- {
- Text = "SendBurstDtmf",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- sendBurstDtmfBtn.Clicked += SendBurstDtmfBtn_Clicked;
-
- var preferredCallSubscriptionBtn = new Button
- {
- Text = "SetGetPreferredVoicesubscription",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- preferredCallSubscriptionBtn.Clicked += PreferredSubscriptionBtn_Clicked;
-
- entry = new Entry
- {
- IsVisible = false,
- Keyboard = Keyboard.Telephone,
- Placeholder = "Enter phone number",
- HeightRequest = 80,
- BackgroundColor = new Color(255,255,255)
- };
- entry.Completed += Entry_Completed;
-
- ScrollView scrollView = new ScrollView()
- {
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- getCallBtn, getAllCallBtn, preferredCallSubscriptionBtn, dialCallBtn, entry, ansCallBtn, endCallBtn, holdCallBtn, activeCallBtn, swapCallBtn, joinCallBtn, transferCallBtn,
- startstopContDtmfBtn, sendBurstDtmfBtn, splitCallBtn, setMuteStBtn, getMuteStBtn, setVolumeInfoBtn, getVolumeInfoBtn, setSoundPathBtn
- }
- },
- VerticalOptions = LayoutOptions.Center
- };
-
- Content = scrollView;
- }
-
- private async void ActiveCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Activate call start");
- uint x = await call.ActiveCall(heldCallHandle);
- Log.Debug(Globals.LogTag, "Activate call end, call id = " + x);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Activate call ,exception = " + ex.ToString());
- }
- }
-
- private async void HoldCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Hold call start");
- uint x = await call.HoldCall(activeCallHandle);
- Log.Debug(Globals.LogTag, "Hold call end, call id = " + x);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Hold call ,exception = " + ex.ToString());
- }
- }
-
- private async void EndCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(CallEndType)));
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- Log.Debug(Globals.LogTag, "End call start");
- CallEndType type = (CallEndType)Enum.Parse(typeof(CallEndType), action);
- CallEndData data = await call.EndCall(activeCallHandle, type);
- Log.Debug(Globals.LogTag, "End call success, call id = " + data.Id + ", end type = " + data.Type);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "End call ,exception = " + ex.ToString());
- }
- }
-
- private async void AnsCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(CallAnswerType)));
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- Log.Debug(Globals.LogTag, "Answer call start .. incoming call id = "+incomingCallHandle);
- CallAnswerType type = (CallAnswerType)Enum.Parse(typeof(CallAnswerType), action);
- uint x = await call.AnswerCall(incomingCallHandle, type);
- Log.Debug(Globals.LogTag, "Answer call end, call id = " + x);
- }
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "AnswerCall ,exception = " + ex.ToString());
- }
- }
-
- private void DialCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Dial call start");
- entry.IsVisible = true;
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Dial call ,exception = " + ex.ToString());
- }
- }
-
- private async void Entry_Completed(object sender, EventArgs e)
- {
- try
- {
- num = entry.Text;
- entry.IsVisible = false;
- entry.ClearValue(Entry.TextProperty);
- Log.Debug(Globals.LogTag, "Phone Number entered = " + num);
- var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(CallType)));
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- CallType type = (CallType)Enum.Parse(typeof(CallType), action);
- CallInformation info = new CallInformation(type, EmergencyType.Default, num);
- await call.DialCall(info);
- Log.Debug(Globals.LogTag, "Dial call end");
- }
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Entry_Completed Dial call ,exception = " + ex.ToString());
- }
- }
-
- private void GetCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetCallStatus call start");
- CallStatus data = call.GetCallStatus((int)activeCallHandle);
- Log.Debug(Globals.LogTag, "GetCallStatus call end, callstatus, id = " + data.CallHandle + ",number = " + data.PhoneNumber + ",volte call =" + data.IsVolteCall +
- ",state = " + data.State + ",type = " + data.Type + ",conference call = " + data.IsConferenceState + ",Mo call = " + data.IsMoCall);
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetCallStatus ,exception = " + ex.ToString());
- }
- }
-
- private void GetAllCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetAllCallStatus call start");
- List<CallStatus> callStatusList = call.GetAllCallStatus().ToList();
- if (callStatusList.Count > 0)
- {
- foreach (CallStatus stat in callStatusList)
- {
- Log.Debug(Globals.LogTag, "isconference = " + stat.IsConferenceState + ", handle =" + stat.CallHandle + ", type =" + stat.Type);
- Log.Debug(Globals.LogTag, "ismocall = " + stat.IsMoCall + ", isvoltecall =" + stat.IsVolteCall);
- Log.Debug(Globals.LogTag, "number = " + stat.PhoneNumber + ", state =" + stat.State);
- }
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "There are no current calls !!");
- }
-
- Log.Debug(Globals.LogTag, "GetAllCallStatus call end");
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetAllCallStatus ,exception = " + ex.ToString());
- }
- }
-
- private async void SwapCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Swap call start");
- uint p = activeCallHandle;
- uint q = heldCallHandle;
- uint x = await call.SwapCall(activeCallHandle, heldCallHandle);
- await Task.Delay(3000);
- if (p == heldCallHandle && q == activeCallHandle)
- {
- Log.Debug(Globals.LogTag, "Swap call ends with success, call id = "+x);
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "Swap call gets failed");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Swap call ,exception = " + ex.ToString());
- }
- }
-
- private async void JoinCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Join call start");
- uint x = await call.JoinCall(activeCallHandle, heldCallHandle);
- Log.Debug(Globals.LogTag, "Join call ends with success, call id = "+x);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Join call ,exception = " + ex.ToString());
- }
- }
-
- private async void SplitCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Split call start");
- var action = await DisplayActionSheet("Operation", "Cancel", null, "Active call", "Held Call");
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- uint handle;
- if (action == "Active call")
- handle = activeCallHandle;
- else
- handle = heldCallHandle;
- uint x = await call.SplitCall(handle);
- Log.Debug(Globals.LogTag, "Split call ends with success, call id = " + x);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Split call ,exception = " + ex.ToString());
- }
- }
-
- private async void TransferCallBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Transfer call starts");
- uint x = await call.TransferCall(activeCallHandle);
- Log.Debug(Globals.LogTag, "Transfer call ends with success, call id = " + x);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Transfer call ,exception = " + ex.ToString());
- }
- }
-
- private async void SetVolumeInfoBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Set call volume info start");
- var actionDev = await DisplayActionSheet("Device", "Cancel", null, Enum.GetNames(typeof(SoundDevice)));
- var actionType = await DisplayActionSheet("Type", "Cancel", null, Enum.GetNames(typeof(SoundType)));
- var actionVolume = await DisplayActionSheet("Volume", "Cancel", null, Enum.GetNames(typeof(SoundVolume)));
- Log.Debug(Globals.LogTag, "Action: Device = " + actionDev + ", type = " + actionType +", Volume = " + actionVolume);
- if (actionDev != null && actionType != null && actionVolume != null)
- {
- SoundDevice device = (SoundDevice)Enum.Parse(typeof(SoundDevice), actionDev);
- SoundType type = (SoundType)Enum.Parse(typeof(SoundType), actionType);
- SoundVolume volume = (SoundVolume)Enum.Parse(typeof(SoundVolume), actionVolume);
- CallVolumeRecord volumeRecord = new CallVolumeRecord(device, type, volume);
- await call.SetCallVolumeInfo(volumeRecord);
- Log.Debug(Globals.LogTag, "Set call volume info ends with success");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Set call volume info ,exception = " + ex.ToString());
- }
- }
-
- private async void GetVolumeInfoBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Get call volume info start");
- var actionDev = await DisplayActionSheet("Device", "Cancel", null, Enum.GetNames(typeof(SoundDevice)));
- var actionType = await DisplayActionSheet("Type", "Cancel", null, Enum.GetNames(typeof(SoundType)));
- Log.Debug(Globals.LogTag, "Action: Device = " + actionDev + ", type = " + actionType);
- if (actionDev != null && actionType != null)
- {
- SoundDevice device = (SoundDevice)Enum.Parse(typeof(SoundDevice), actionDev);
- SoundType type = (SoundType)Enum.Parse(typeof(SoundType), actionType);
- CallVolumeInfo info = await call.GetCallVolumeInfo(device, type);
- Log.Debug(Globals.LogTag, "Get call volume info ends with success, id = "+info.RecordId);
- var list = info.Records.ToList();
- if(list != null)
- {
- foreach(CallVolumeRecord record in list)
- {
- Log.Debug(Globals.LogTag, "Callvolumerecord: device = " + record.Device + ",type = "+record.Type +", volume = "+ record.Volume);
- }
- }
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Get call volume info ,exception = " + ex.ToString());
- }
- }
-
- private async void SetMuteStBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Set call mute status start");
- var actionPath = await DisplayActionSheet("Path", "Cancel", null, Enum.GetNames(typeof(SoundMutePath)));
- var actionSt = await DisplayActionSheet("Mute Status", "Cancel", null, Enum.GetNames(typeof(SoundMuteStatus)));
- Log.Debug(Globals.LogTag, "Action: path = " + actionPath + ", mute status = "+ actionSt);
- if (actionPath != null && actionSt != null)
- {
- SoundMutePath path = (SoundMutePath)Enum.Parse(typeof(SoundMutePath), actionPath);
- SoundMuteStatus status = (SoundMuteStatus)Enum.Parse(typeof(SoundMuteStatus), actionSt);
- CallMuteStatusRecord record = new CallMuteStatusRecord(path, status);
- await call.SetCallMuteStatus(record);
- Log.Debug(Globals.LogTag, "Set call mute status ends");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Set mute status, exception = " + ex.ToString());
- }
- }
-
- private async void GetMuteStBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Get call mute status start");
- CallMuteStatusRecord record = await call.GetCallMuteStatus();
- Log.Debug(Globals.LogTag, "Get call mute status ends, mute status = "+ record.Status + ", mute path = " + record.Path);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Get mute status, exception = " + ex.ToString());
- }
- }
-
- private async void StartStopContDtmfBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Continuous Dtmf starts");
- await call.StartContDtmfCall(1);
- await Task.Delay(15000);
- await call.StopContDtmfCall();
- Log.Debug(Globals.LogTag, "Continuous Dtmf stops");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Start and stop continuous Dtmf, exception = " + ex.ToString());
- }
- }
-
- private async void SendBurstDtmfBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Send burst Dtmf starts");
- var actionWidth = await DisplayActionSheet("Width", "Cancel", null, Enum.GetNames(typeof(CallDtmfPulseWidth)));
- var actionInterval = await DisplayActionSheet("Interval", "Cancel", null, Enum.GetNames(typeof(CallDtmfDigitInterval)));
- Log.Debug(Globals.LogTag, "Action: width = " + actionWidth + ", interval = " + actionInterval);
- if (actionWidth != null && actionInterval != null)
- {
- CallDtmfPulseWidth width = (CallDtmfPulseWidth)Enum.Parse(typeof(CallDtmfPulseWidth), actionWidth);
- CallDtmfDigitInterval interval = (CallDtmfDigitInterval)Enum.Parse(typeof(CallDtmfDigitInterval), actionInterval);
- CallBurstDtmfData data = new CallBurstDtmfData("12345", width, interval);
- await call.SendBurstDtmfCall(data);
- Log.Debug(Globals.LogTag, "Send burst Dtmf ends");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Send burst Dtmf, exception = " + ex.ToString());
- }
- }
-
- private async void SetSoundPathBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Set call sound path start");
- var actionPath = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(SoundPath)));
- var actionVolume = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(ExtraVolume)));
- Log.Debug(Globals.LogTag, "Action: Path = " + actionPath + ", Volume = "+ actionVolume);
- if (actionPath != null && actionVolume != null)
- {
- SoundPath path = (SoundPath)Enum.Parse(typeof(SoundPath), actionPath);
- ExtraVolume volume = (ExtraVolume)Enum.Parse(typeof(ExtraVolume), actionVolume);
- CallSoundPathInfo pathInfo = new CallSoundPathInfo(path, volume);
- await call.SetCallSoundPath(pathInfo);
- Log.Debug(Globals.LogTag, "Set call sound path ends with success");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Set call sound path,exception = " + ex.ToString());
- }
- }
-
- public async void PreferredSubscriptionBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(CallPreferredVoiceSubscription)));
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- CallPreferredVoiceSubscription subscription = (CallPreferredVoiceSubscription)Enum.Parse(typeof(CallPreferredVoiceSubscription), action);
- Log.Debug(Globals.LogTag, "CallPreferredVoiceSubscription start -- Set subscription to "+ subscription);
- await call.SetCallPreferredVoiceSubscription(subscription);
- CallPreferredVoiceSubscription subs = call.GetCallPreferredVoiceSubscription();
- Log.Debug(Globals.LogTag, "Current CallPreferredVoiceSubscription = " + subs);
- if (subs == subscription)
- Log.Debug(Globals.LogTag, "CallPreferredVoiceSubscription set and get subscription is successful");
- else
- Log.Debug(Globals.LogTag, "CallPreferredVoiceSubscription set and get subscription has failed");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "PreferredVoiceSubscription ,exception = " + ex.ToString());
- }
- }
-
- private void RegisterNotiCallEvents(TapiHandle handle)
- {
- handle.PropertyChanged += Handle_CallPropertyChanged;
-
- handle.NotificationChanged += Handle_CallNotificationChanged;
- foreach (Notification i in arrNoti)
- {
- handle.RegisterNotiEvent(i);
- }
- handle.RegisterPropEvent(Property.NetworkPsType);
- }
-
- private void Handle_CallPropertyChanged(object sender, PropertyChangedEventArgs e)
- {
- Log.Debug(Globals.LogTag, "Handle_CallPropertyChanged event receive, " + e.Property + e.Data);
- }
-
- private void Handle_CallNotificationChanged(object sender, NotificationChangedEventArgs e)
- {
- try
- {
- Notification id = e.Id;
- Log.Debug(Globals.LogTag, "Handle_CallNotificationChanged event receive, Notification Value = " + id);
- switch (id)
- {
- case Notification.NetworkDefaultSubscription:
- Log.Debug(Globals.LogTag, "Notification.NetworkDefaultSubscription event receive , data =" +e.Data);
- break;
- case Notification.IdleVoiceCall:
- Log.Debug(Globals.LogTag, "Notification.IdleVoiceCall event receive");
- CallIdleStatusNotificationData status = (CallIdleStatusNotificationData)e.Data;
- Log.Debug(Globals.LogTag, "CallIdleStatusNotificationData , notiid = " + status.NotiId + ", end cause = " + status.EndCause);
- break;
- case Notification.ActiveVoiceCall:
- activeCallHandle = (uint)e.Data;
- Log.Debug(Globals.LogTag, "Notification.ActiveVoiceCall event receive, notiid = " + e.Id + ", callid= " + activeCallHandle);
- break;
- case Notification.HeldVoiceCall:
- heldCallHandle = (uint)e.Data;
- Log.Debug(Globals.LogTag, "Notification.HeldVoiceCall event receive, notiid = " + e.Id + ", callid= " + heldCallHandle);
- break;
- case Notification.AlertVoiceCall:
- Log.Debug(Globals.LogTag, "Notification.AlertVoiceCall event receive, notiid = " + e.Id + ", callid= " + e.Data);
- break;
- case Notification.DialingVoiceCall:
- Log.Debug(Globals.LogTag, "Notification.DialingVoiceCall event receive, notiid = " + e.Id + ", callid= " + e.Data);
- break;
- case Notification.IncomingVoiceCall:
- Log.Debug(Globals.LogTag, "Notification.IncomingVoiceCall event receive");
- CallIncomingInfo info = (CallIncomingInfo)e.Data;
- incomingCallHandle = info.CallHandle;
- Log.Debug(Globals.LogTag, "CallIncomingInfo data , callid = " + incomingCallHandle + ", callernumber = " + info.CallerNumber + ", calltype= " + info.CallType
- + ", callmode = " + info.CliMode + ", active line = " + info.ActiveLine + ", nocli cause = " + info.CliCause + ",isfwded = " + info.IsForwarded
- + ", name = " + info.NameInfo.Name + ", namemode = " + info.NameInfo.NameMode);
- break;
- case Notification.HeldCallInfo:
- Log.Debug(Globals.LogTag, "Notification.HeldCallInfo event receive, notiid = " + e.Id + ", data= " + e.Data);
- break;
- case Notification.ActiveCallInfo:
- Log.Debug(Globals.LogTag, "Notification.ActiveCallInfo event receive, notiid = " + e.Id + ", data= " + e.Data);
- break;
- case Notification.JoinedCallInfo:
- Log.Debug(Globals.LogTag, "Notification.JoinedCallInfo event receive, notiid = " + e.Id + ", data= " + e.Data);
- break;
- case Notification.CallSoundRingbackTone:
- Log.Debug(Globals.LogTag, "Notification.CallSoundRingbackTone event receive, notiid = " + e.Id + ", data= " + e.Data);
- break;
- case Notification.CallPreferredVoiceSubscription:
- Log.Debug(Globals.LogTag, "Notification.CallPreferredVoiceSubscription event receive, notiid = " + e.Id + ", data= " + e.Data);
- break;
- case Notification.CallSoundWbamr:
- Log.Debug(Globals.LogTag, "Notification.CallSoundWbamr event receive, notiid = " + e.Id + ", data= " + e.Data);
- break;
- case Notification.CallSoundPath:
- Log.Debug(Globals.LogTag, "Notification.CallSoundPath event receive, notiid = " + e.Id + ", data= " + e.Data);
- break;
- }
-
- Log.Debug(Globals.LogTag, "Handle_CallNotificationChanged event receive end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Handle_CallNotificationChanged event exception = "+ex.ToString());
- }
- }
-
- }
-}
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using Xamarin.Forms;
-using Tizen.Tapi;
-using Tizen;
-using System.Linq;
-
-namespace XamarinForTizen.Tizen
-{
- public class CommonPage : ContentPage
- {
- List<string> cplist = new List<string>();
- public CommonPage()
- {
- var cpNameBtn = new Button
- {
- Text = "CPName",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- cpNameBtn.Clicked += cpNameBtn_Clicked;
-
- var initBtn0 = new Button
- {
- Text = "InitTapimodem0",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- initBtn0.Clicked += initBtn0_Clicked;
-
- var initBtn1 = new Button
- {
- Text = "InitTapimodem1",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- initBtn1.Clicked += initBtn1_Clicked;
-
- var deinitBtn0 = new Button
- {
- Text = "DeinitTapimodem0",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- deinitBtn0.Clicked += deinitBtn0_Clicked;
-
- var deinitBtn1 = new Button
- {
- Text = "DeinitTapimodem1",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- deinitBtn1.Clicked += deinitBtn1_Clicked;
-
- var getIntPropBtn = new Button
- {
- Text = "GetIntProperty",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getIntPropBtn.Clicked += GetIntPropBtn_Clicked;
-
- var getStrPropBtn = new Button
- {
- Text = "GetStringProperty",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getStrPropBtn.Clicked += GetStrPropBtn_Clicked;
-
- var getReadyBtn = new Button
- {
- Text = "GetReadyState",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getReadyBtn.Clicked += GetReadyBtn_Clicked;
-
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- cpNameBtn, initBtn0, deinitBtn0, initBtn1, deinitBtn1, getIntPropBtn, getStrPropBtn, getReadyBtn
- }
- };
- }
-
- private void GetReadyBtn_Clicked(object sender, EventArgs e)
- {
- //Get the state of Tapi
- int s = TapiManager.State;
- if (s == 0)
- Log.Debug(Globals.LogTag, "Tapi state, result = false");
- else if (s == 1)
- Log.Debug(Globals.LogTag, "Tapi state, result = true");
- else
- Log.Debug(Globals.LogTag, "Tapi state, result = " + s);
- }
-
- private async void GetStrPropBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- var action = await DisplayActionSheet("Operation", "Cancel", null, "Network Name", "Network Spn Name", "Network Name Option");
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- Property p = Property.NetworkPlmn;
- if (action == "Network Name")
- p = Property.NetworkName;
- else if (action == "Network Spn Name")
- p = Property.NetworkSpnName;
- else if (action == "Network Name Option")
- p = Property.NetworkNameOption;
- if (Globals.handleModem0 != null)
- {
- string val = Globals.handleModem0.GetStringProperty(p);
- Log.Debug(Globals.LogTag, "String property result = " + val);
- }
- else if (Globals.handleModem1 != null)
- {
- string val = Globals.handleModem1.GetStringProperty(p);
- Log.Debug(Globals.LogTag, "String property result = " + val);
- }
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetStringProperty tapi exception = " + ex.ToString());
- }
- }
-
- private async void GetIntPropBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- var action = await DisplayActionSheet("Operation", "Cancel", null, "Ps Type", "Power", "Dongle Status");
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- Property p = Property.NetworkPlmn;
- if (action == "Ps Type")
- p = Property.NetworkPsType;
- else if (action == "Power")
- p = Property.ModemPower;
- else if (action == "Dongle Status")
- p = Property.ModemDongleStatus;
- if (Globals.handleModem0 != null)
- {
- int val = Globals.handleModem0.GetIntProperty(p);
- Log.Debug(Globals.LogTag, "Int property result = " + val);
- }
- else if (Globals.handleModem1 != null)
- {
- int val = Globals.handleModem1.GetIntProperty(p);
- Log.Debug(Globals.LogTag, "Int property result = " + val);
- }
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetIntProperty tapi exception = " + ex.ToString());
- }
- }
-
- private void deinitBtn1_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.handleModem1 != null)
- {
- TapiManager.DeinitTapi(Globals.handleModem1);
- Log.Debug(Globals.LogTag, "Deinit tapi is successful");
- }
- else
- Log.Debug(Globals.LogTag, "TapiHandle is null");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "inside deinit tapi exception = " + ex.ToString());
- }
- }
-
- private void deinitBtn0_Clicked(object sender, EventArgs e)
- {
- try
- {
- if (Globals.handleModem0 != null)
- {
- TapiManager.DeinitTapi(Globals.handleModem0);
- Log.Debug(Globals.LogTag, "Deinit tapi is successful");
- }
- else
- Log.Debug(Globals.LogTag, "TapiHandle is null");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "inside deinit tapi exception = " + ex.ToString());
- }
- }
-
- private void initBtn1_Clicked(object sender, EventArgs e)
- {
- try
- {
- Globals.handleModem1 = TapiManager.InitTapi(cplist[1]);
- if (Globals.handleModem1 == null)
- Log.Debug(Globals.LogTag, "Init tapi is not successful and TapiHandle is null");
- else
- Log.Debug(Globals.LogTag, "Init tapi is successful");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "inside init tapi exception = " + ex.ToString());
- }
- }
-
- private void initBtn0_Clicked(object sender, EventArgs e)
- {
- try
- {
- Globals.handleModem0 = TapiManager.InitTapi(cplist[0]);
- if (Globals.handleModem0 == null)
- Log.Debug(Globals.LogTag, "Init tapi is not successful and TapiHandle is null");
- else
- Log.Debug(Globals.LogTag, "Init tapi is successful");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "inside init tapi exception = " + ex.ToString());
- }
- }
-
- private void cpNameBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- cplist = TapiManager.GetCpNames().ToList();
- if (cplist != null)
- {
- Log.Debug(Globals.LogTag, "inside common button clicked ");
- for (int i = 0; i < cplist.Count; i++)
- Log.Debug(Globals.LogTag, "Cp name = " + cplist[i]);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Getcpnames throw exception = " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using Xamarin.Forms;
-
-namespace XamarinForTizen.Tizen
-{
- public class MainPage : ContentPage
- {
- public MainPage()
- {
- var commonBtn = new Button
- {
- Text = "Common",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- commonBtn.Clicked += CommonBtn_Clicked;
-
- var callgsmBtn = new Button
- {
- Text = "Call-Gsm",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- callgsmBtn.Clicked += CallgsmBtn_Clicked;
-
- var modemBtn = new Button
- {
- Text = "Modem",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- modemBtn.Clicked += ModemBtn_Clicked;
-
- var nwBtn = new Button
- {
- Text = "Network",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- nwBtn.Clicked += NwBtn_Clicked;
-
- var simBtn = new Button
- {
- Text = "Sim",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- simBtn.Clicked += simBtn_Clicked;
-
- var phonebookBtn = new Button
- {
- Text = "Phonebook",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- phonebookBtn.Clicked += phonebookBtn_Clicked;
-
- var ssBtn = new Button
- {
- Text = "Ss",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- ssBtn.Clicked += ssBtn_Clicked;
-
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- commonBtn, callgsmBtn, modemBtn, nwBtn, simBtn, phonebookBtn, ssBtn
- }
- };
- }
-
- private async void ssBtn_Clicked(object sender, EventArgs e)
- {
- await Navigation.PushAsync(new SsPage());
- }
-
- private async void phonebookBtn_Clicked(object sender, EventArgs e)
- {
- await Navigation.PushAsync(new PhonebookPage());
- }
-
- private async void simBtn_Clicked(object sender, EventArgs e)
- {
- await Navigation.PushAsync(new SimPage());
- }
-
- private async void NwBtn_Clicked(object sender, EventArgs e)
- {
- await Navigation.PushAsync(new NetworkPage());
- }
-
- private async void CallgsmBtn_Clicked(object sender, EventArgs e)
- {
- await Navigation.PushAsync(new CallPage());
- }
-
- private async void ModemBtn_Clicked(object sender, EventArgs e)
- {
- await Navigation.PushAsync(new ModemPage());
- }
-
- private async void CommonBtn_Clicked(object sender, EventArgs e)
- {
- await Navigation.PushAsync(new CommonPage());
- }
- }
-}
+++ /dev/null
-using System;
-using Xamarin.Forms;
-using Tizen;
-using Tizen.Tapi;
-using System.Threading.Tasks;
-
-namespace XamarinForTizen.Tizen
-{
- public class ModemPage : ContentPage
- {
- Modem modem = null;
- public ModemPage()
- {
- try
- {
- modem = new Modem(Globals.handleModem0);
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Modem constructor throws exception = " + ex.ToString());
- }
-
- var processPowerCommandBtn = new Button
- {
- Text = "ProcessPowerCommand",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- processPowerCommandBtn.Clicked += processPowerBtn_Clicked;
-
- var flightModeBtn = new Button
- {
- Text = "SetGetFlightMode",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- flightModeBtn.Clicked += FlightModeBtn_Clicked;
-
- var miscMeVersionBtn = new Button
- {
- Text = "GetMiscMeVersion_async_and_sync",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- miscMeVersionBtn.Clicked += MiscVersionBtn_Clicked;
-
- var miscMeSnBtn = new Button
- {
- Text = "GetMiscMeSn_async_and_sync",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- miscMeSnBtn.Clicked += MiscMeSnBtn_Clicked;
-
- var miscMeImeiBtn = new Button
- {
- Text = "GetMiscMeImei_async_and_sync",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- miscMeImeiBtn.Clicked += MiscMeImeiBtn_Clicked;
-
- var checkPowerBtn = new Button
- {
- Text = "CheckPowerStatus",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- checkPowerBtn.Clicked += CheckPowerBtn_Clicked;
-
- var deviceInfoBtn = new Button
- {
- Text = "GetDeviceInfo",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- deviceInfoBtn.Clicked += DeviceInfoBtn_Clicked;
-
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- processPowerCommandBtn, flightModeBtn, miscMeVersionBtn, miscMeSnBtn, miscMeImeiBtn, checkPowerBtn, deviceInfoBtn
- }
- };
- }
-
- private async void DeviceInfoBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetDeviceInfo call start");
- MiscDeviceInfo info = await modem.GetDeviceInfo();
- if (info!= null)
- {
- Log.Debug(Globals.LogTag, "MiscDeviceInfo data is -- ");
- Log.Debug(Globals.LogTag, "DeviceName = " + info.DeviceName);
- Log.Debug(Globals.LogTag, "VendorName = " + info.VendorName);
- }
- Log.Debug(Globals.LogTag, "GetDeviceInfo call end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Getdeviceinfo ,exception = " + ex.ToString());
- }
- }
-
- private void CheckPowerBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "CheckPowerStatus call start");
- PhonePowerStatus status = modem.CheckPowerStatus();
- Log.Debug(Globals.LogTag, "power status = " + status);
- Log.Debug(Globals.LogTag, "CheckPowerStatus call end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "CheckPowerStatus ,exception = " + ex.ToString());
- }
- }
-
- private async void MiscMeImeiBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetMiscMeImei async call start");
- string info = await modem.GetMiscMeImei();
- if (info != null)
- {
- Log.Debug(Globals.LogTag, "MiscImei number is -- " + info);
- }
-
- Log.Debug(Globals.LogTag, "GetMiscMeImei async call end");
- Log.Debug(Globals.LogTag, "GetMiscMeImei sync call start");
- string infosync = modem.MiscMeImeiSync;
- if (infosync != null)
- {
- Log.Debug(Globals.LogTag, "MiscImei number is -- " +infosync);
- }
-
- Log.Debug(Globals.LogTag, "GetMiscMeImei sync call end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetMiscMeImei ,exception = " + ex.ToString());
- }
- }
-
- private async void MiscMeSnBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetMiscMeSn async call start");
- MiscSerialNumberInformation info = await modem.GetMiscMeSn();
- if (info != null)
- {
- Log.Debug(Globals.LogTag, "MiscSerialNumberInformation data is -- ");
- Log.Debug(Globals.LogTag, "Esn = " + info.Esn);
- Log.Debug(Globals.LogTag, "Imei = " + info.Imei);
- Log.Debug(Globals.LogTag, "ImeiSv = " + info.ImeiSv);
- Log.Debug(Globals.LogTag, "Meid = " + info.MeId);
- }
-
- Log.Debug(Globals.LogTag, "GetMiscMeSn async call end");
- Log.Debug(Globals.LogTag, "GetMiscMeSn sync call start");
- MiscSerialNumberInformation infosync = modem.MiscMeSnSync;
- if (infosync != null)
- {
- Log.Debug(Globals.LogTag, "MiscSerialNumberInformation data is -- ");
- Log.Debug(Globals.LogTag, "Esn = " + infosync.Esn);
- Log.Debug(Globals.LogTag, "Imei = " + infosync.Imei);
- Log.Debug(Globals.LogTag, "ImeiSv = " + infosync.ImeiSv);
- Log.Debug(Globals.LogTag, "Meid = " + infosync.MeId);
- }
-
- Log.Debug(Globals.LogTag, "GetMiscMeSn sync call end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetMiscMeSn ,exception = " + ex.ToString());
- }
- }
-
- private async void FlightModeBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Modem flightmode call start");
- await modem.SetFlightMode(PowerFlightModeRequest.Enter);
- Log.Debug(Globals.LogTag, "Modem flightmode set Enter success");
- bool isFlightMode = await modem.GetFlightMode();
- Log.Debug(Globals.LogTag, "Modem flightmode get success , flightmode = "+ isFlightMode);
- await modem.SetFlightMode(PowerFlightModeRequest.Leave);
- Log.Debug(Globals.LogTag, "Modem flightmode set Leave success");
- isFlightMode = await modem.GetFlightMode();
- Log.Debug(Globals.LogTag, "Modem flightmode get success , flightmode = " + isFlightMode);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Modem flightmode ,exception = " + ex.ToString());
- }
- }
-
- private async void processPowerBtn_Clicked(object sender, EventArgs e)
- {
- TapiHandle handle = Globals.handleModem0;
- try
- {
- handle.NotificationChanged += Handle_NotiPowerStatusChanged;
- handle.RegisterNotiEvent(Notification.ModemPower);
- Log.Debug(Globals.LogTag, "Modem powercommand call start");
- await modem.ProcessPowerCommand(PhonePowerCommand.Off);
- Log.Debug(Globals.LogTag, "Modem powercommand call off success");
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Modem processpower command ,exception = " + ex.ToString());
- }
-
- finally
- {
- handle.DeregisterNotiEvent(Notification.ModemPower);
- handle.NotificationChanged -= Handle_NotiPowerStatusChanged;
- }
- }
-
- private async void MiscVersionBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetMiscMeVersion async call start");
- MiscVersionInformation info = await modem.GetMiscMeVersion();
- if (info!=null)
- {
- Log.Debug(Globals.LogTag, "MiscVersionInformation data is -- ");
- Log.Debug(Globals.LogTag, "Version = " + info.VersionMask.ToString());
- Log.Debug(Globals.LogTag, "CalculationDate = " + info.CalculationDate);
- Log.Debug(Globals.LogTag, "Erinam = " + info.EriNam.ToString());
- Log.Debug(Globals.LogTag, "EriVersion = " + info.EriVersion);
- Log.Debug(Globals.LogTag, "Hwversion = " + info.HwVersion);
- Log.Debug(Globals.LogTag, "Swversion = " + info.SwVersion);
- Log.Debug(Globals.LogTag, "ModelId = " + info.ModelId);
- Log.Debug(Globals.LogTag, "Prlnam = " + info.PrlNam.ToString());
- Log.Debug(Globals.LogTag, "Prlversion = " + info.PrlVersion);
- Log.Debug(Globals.LogTag, "Productcode = " + info.ProductCode);
- }
-
- Log.Debug(Globals.LogTag, "GetMiscMeVersion async call end");
- Log.Debug(Globals.LogTag, "GetMiscMeVersion sync call start");
- MiscVersionInformation infosync = modem.MiscMeVersionSync;
- if (infosync != null)
- {
- Log.Debug(Globals.LogTag, "MiscVersionInformation data is -- ");
- Log.Debug(Globals.LogTag, "Version = " + infosync.VersionMask.ToString());
- Log.Debug(Globals.LogTag, "CalculationDate = " + infosync.CalculationDate);
- Log.Debug(Globals.LogTag, "Erinam = " + infosync.EriNam.ToString());
- Log.Debug(Globals.LogTag, "EriVersion = " + infosync.EriVersion);
- Log.Debug(Globals.LogTag, "Hwversion = " + infosync.HwVersion);
- Log.Debug(Globals.LogTag, "Swversion = " + infosync.SwVersion);
- Log.Debug(Globals.LogTag, "ModelId = " + infosync.ModelId);
- Log.Debug(Globals.LogTag, "Prlnam = " + infosync.PrlNam.ToString());
- Log.Debug(Globals.LogTag, "Prlversion = " + infosync.PrlVersion);
- Log.Debug(Globals.LogTag, "Productcode = " + infosync.ProductCode);
- }
-
- Log.Debug(Globals.LogTag, "GetMiscMeVersion sync call end");
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetMiscMeVersion ,exception = " + ex.ToString());
- }
- }
-
- private void Handle_PropertyPowerStatusChanged(object sender, PropertyChangedEventArgs e)
- {
- Log.Debug(Globals.LogTag, "Handle_PropertyPowerStatusChanged event receive");
- //Log.Debug(Globals.LogTag, "Handle_PropertyPowerStatusChanged event receive, status = " + e.Data + e.Property);
- }
-
- private void Handle_NotiPowerStatusChanged(object sender, NotificationChangedEventArgs e)
- {
- Log.Debug(Globals.LogTag, "Handle_NotiPowerStatusChanged event receive, status = " + e.Data + ", Notification Value = " +e.Id);
- }
- }
-}
+++ /dev/null
-using Xamarin.Forms;
-using Tizen.Tapi;
-using System;
-using Tizen;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace XamarinForTizen.Tizen
-{
- public class NetworkPage : ContentPage
- {
- Network network = null;
- double height = 62.0;
- Notification[] arrNoti = { Notification.NetworkCellInfo, Notification.NetworkRegistrationStatus, Notification.NetworkIdentity, Notification.NetworkChange, Notification.NetworkDefaultDataSubscription, Notification.NetworkDefaultSubscription };
- Property[] arrProp = { Property.NetworkCellId, Property.NetworkSignalLevel, Property.NetworkPsType, Property.NetworkName, Property.NetworkCircuitStatus,
- Property.NetworkNameOption, Property.NetworkPlmn, Property.NetworkServiceType, Property.NetworkPacketStatus};
- public NetworkPage()
- {
- try
- {
- network = new Network(Globals.handleModem0);
- RegisterNwEvents(Globals.handleModem0);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Network constructor throws exception = " + ex.ToString());
- }
-
- var searchNwBtn = new Button
- {
- Text = "SearchNetwork",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- searchNwBtn.Clicked += SearchNwBtn_Clicked;
-
- var selectAutoNwBtn = new Button
- {
- Text = "SelectAutoNetwork",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- selectAutoNwBtn.Clicked += SelectAutoNwBtn_Clicked;
-
- var selectManualNwBtn = new Button
- {
- Text = "SelectManualNetwork",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- selectManualNwBtn.Clicked += SelectManualNwBtn_Clicked;
-
- var getNwModeBtn = new Button
- {
- Text = "GetNetworkSelectionMode",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- getNwModeBtn.Clicked += GetNwModeBtn_Clicked;
-
- var getPrefPlmnBtn = new Button
- {
- Text = "GetPreferredPlmn",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- getPrefPlmnBtn.Clicked += GetPrefPlmnBtn_Clicked;
-
- var setPrefPlmnBtn = new Button
- {
- Text = "SetPreferredPlmn",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- setPrefPlmnBtn.Clicked += SetPrefPlmnBtn_Clicked;
-
- var cancelSearchBtn = new Button
- {
- Text = "CancelSearch",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- cancelSearchBtn.Clicked += CancelSearchBtn_Clicked;
-
- var getServBtn = new Button
- {
- Text = "GetNetworkServing",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- getServBtn.Clicked += GetServBtn_Clicked;
-
- var setgetModeBtn = new Button
- {
- Text = "SetGetNetworkMode",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- setgetModeBtn.Clicked += SetGetModeBtn_Clicked;
-
- var getNeighborBtn = new Button
- {
- Text = "GetNeighborCell",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- getNeighborBtn.Clicked += GetNeighborBtn_Clicked;
-
- var setemergencyBtn = new Button
- {
- Text = "SetEmergency",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- setemergencyBtn.Clicked += SetEmergencyModeBtn_Clicked;
-
- var setgetRoamPrefBtn = new Button
- {
- Text = "SetGetRoamPreference",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- setgetRoamPrefBtn.Clicked += SetGetRoamPrefBtn_Clicked;
-
- var setgetDataSubsBtn = new Button
- {
- Text = "SetGetDefaultDataSubscription",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- setgetDataSubsBtn.Clicked += SetGetDataSubsBtn_Clicked;
-
- var setgetNwSubsBtn = new Button
- {
- Text = "SetGetDefaultSubscription",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- HeightRequest = height
- };
- setgetNwSubsBtn.Clicked += SetGetNwSubsBtn_Clicked;
-
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- searchNwBtn, selectAutoNwBtn, selectManualNwBtn, getNwModeBtn, getPrefPlmnBtn, setPrefPlmnBtn, cancelSearchBtn , getServBtn ,
- setgetModeBtn, getNeighborBtn, setemergencyBtn, setgetRoamPrefBtn, setgetDataSubsBtn, setgetNwSubsBtn
- }
- };
- }
-
- private void RegisterNwEvents(TapiHandle handle)
- {
- handle.PropertyChanged += Handle_NwPropertyChanged;
-
- handle.NotificationChanged += Handle_NwNotificationChanged;
- foreach (Notification i in arrNoti)
- {
- handle.RegisterNotiEvent(i);
- }
-
- foreach (Property i in arrProp)
- {
- handle.RegisterPropEvent(i);
- }
- }
-
- private void Handle_NwNotificationChanged(object sender, NotificationChangedEventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Handle_NwNotificationChanged event receive, Notification Value = " + e.Id);
- switch (e.Id)
- {
- case Notification.NetworkCellInfo:
- NetworkCellNoti data = (NetworkCellNoti)e.Data;
- Log.Debug(Globals.LogTag, "NetworkCellInfo event receive, Lac = " + data.Lac + ", cell id = " + data.CellId);
- break;
- case Notification.NetworkRegistrationStatus:
- NetworkRegistrationStatus status = (NetworkRegistrationStatus)e.Data;
- Log.Debug("NetworkRegistrationStatus event receive , circuit status = ", status.CircuitStatus + ", isroaming = " + status.IsRoaming + ", packetstatus = " + status.PacketStatus + ", type = " + status.Type);
- break;
- case Notification.NetworkIdentity:
- NetworkIdentityNoti noti = (NetworkIdentityNoti)e.Data;
- Log.Debug("NetworkIdentity event receive , fullname = ", noti.FullName + ", plmn = " + noti.Plmn + ", shortname = " + noti.ShortName);
- break;
- case Notification.NetworkChange:
- NetworkChangeNoti changeNoti = (NetworkChangeNoti)e.Data;
- Log.Debug("NetworkChange event receive , plmn = ", changeNoti.Plmn + ", act = " + changeNoti.Act);
- break;
- case Notification.NetworkDefaultDataSubscription:
- Log.Debug(Globals.LogTag, "NetworkDefaultDataSubscription event receive, data = " + e.Data);
- break;
- case Notification.NetworkDefaultSubscription:
- Log.Debug(Globals.LogTag, "NetworkDefaultSubscription event receive, data = " + e.Data);
- break;
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Handle_NwNotificationChanged event exception = " + ex.ToString());
- }
- }
-
- private void Handle_NwPropertyChanged(object sender, PropertyChangedEventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Handle_NwPropertyChanged property receive, Property Value = " + e.Property);
- switch (e.Property)
- {
- case Property.NetworkSignalLevel:
- Log.Debug(Globals.LogTag, "NetworkSignalLevel property receive, data = " + e.Data);
- break;
- case Property.NetworkPsType:
- Log.Debug(Globals.LogTag, "NetworkPsType property receive, data = " + e.Data);
- break;
- case Property.NetworkCellId:
- Log.Debug(Globals.LogTag, "NetworkCellId property receive, data = " + (uint)e.Data);
- break;
- case Property.NetworkCircuitStatus:
- Log.Debug(Globals.LogTag, "NetworkCircuitStatus property receive, data = " + e.Data);
- break;
- case Property.NetworkPacketStatus:
- Log.Debug(Globals.LogTag, "NetworkPacketStatus property receive, data = " + e.Data);
- break;
- case Property.NetworkPlmn:
- Log.Debug(Globals.LogTag, "NetworkPacketStatus property receive, data = " + e.Data);
- break;
- case Property.NetworkName:
- Log.Debug(Globals.LogTag, "NetworkName property receive, data = " + e.Data);
- break;
- case Property.NetworkNameOption:
- Log.Debug(Globals.LogTag, "NetworkNameOption property receive, data = " + e.Data);
- break;
- case Property.NetworkServiceType:
- Log.Debug(Globals.LogTag, "NetworkServiceType property receive, data = " + e.Data);
- break;
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Handle_NwPropertyChanged event exception = " + ex.ToString());
- }
- }
-
- private async void SearchNwBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "SearchNetwork start");
- NetworkPlmnList list = await network.SearchNetwork();
- if (list != null)
- {
- Log.Debug(Globals.LogTag, "SearchNetwork list is not null");
- Log.Debug(Globals.LogTag, "nwcount = " + list.NetworkCount);
- List<NetworkIdentity> idList = list.NetworkList.ToList();
- foreach (NetworkIdentity i in idList)
- {
- Log.Debug(Globals.LogTag, "name = " + i.Name);
- Log.Debug(Globals.LogTag, "plmn = " + i.Plmn);
- Log.Debug(Globals.LogTag, "plmnid = " + i.PlmnId);
- Log.Debug(Globals.LogTag, "plmntype = " + i.PlmnType);
- Log.Debug(Globals.LogTag, "serviceprovidername = " + i.ServiceProviderName);
- Log.Debug(Globals.LogTag, "system type = " + i.SystemType);
- }
- }
-
- Log.Debug(Globals.LogTag, "SearchNetwork end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "SearchNetwork ,exception = " + ex.ToString());
- }
- }
-
- private async void SetPrefPlmnBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "SetNetworkPreferredPlmn start");
- var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(NetworkPreferredPlmnOp)));
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- NetworkPreferredPlmnOp operation = (NetworkPreferredPlmnOp)Enum.Parse(typeof(NetworkPreferredPlmnOp), action);
- if (operation == NetworkPreferredPlmnOp.Add)
- {
- NetworkPreferredPlmnInfo info = new NetworkPreferredPlmnInfo();
- info.Index = 0;
- info.Plmn = "45000";
- info.SystemType = NetworkSystemType.Gsm;
- info.NetworkName = "AAA";
- info.ServiceProviderName = "A";
- await network.SetNetworkPreferredPlmn(operation, info);
- }
- else
- {
- IEnumerable<NetworkPreferredPlmnInfo> infoList = await network.GetNetworkPreferredPlmn();
- if (infoList.Count() > 0)
- {
- NetworkPreferredPlmnInfo info = infoList.First();
- await network.SetNetworkPreferredPlmn(operation, info);
- }
- }
- }
-
- Log.Debug(Globals.LogTag, "SetNetworkPreferredPlmn end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "SetNetworkPreferredPlmn ,exception = " + ex.ToString());
- }
- }
-
- private async void GetPrefPlmnBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetNetworkPreferredPlmn start");
- IEnumerable<NetworkPreferredPlmnInfo> infoList = await network.GetNetworkPreferredPlmn();
- Log.Debug(Globals.LogTag, "GetNetworkPreferredPlmn count = " + infoList.Count());
- if (infoList.Count() > 0)
- {
- List<NetworkPreferredPlmnInfo> data = infoList.ToList();
- foreach (NetworkPreferredPlmnInfo info in data)
- {
- Log.Debug(Globals.LogTag, "plmn = " + info.Plmn + " index = " + info.Index + " type = " + info.SystemType + " nwname = " + info.NetworkName);
- }
- }
-
- Log.Debug(Globals.LogTag, "GetNetworkPreferredPlmn end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetNetworkPreferredPlmn ,exception = " + ex.ToString());
- }
- }
-
- private async void GetNwModeBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetNetworkSelectionMode start");
- NetworkSelectionMode mode = await network.GetNetworkSelectionMode();
- Log.Debug(Globals.LogTag, "GetNetworkSelectionMode end , mode = " + mode);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetNetworkSelectionMode ,exception = " + ex.ToString());
- }
- }
-
- private async void SelectManualNwBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- string plmn = Globals.handleModem0.GetStringProperty(Property.NetworkPlmn);
- int act = Globals.handleModem0.GetIntProperty(Property.NetworkAct);
-
- Log.Debug(Globals.LogTag, "SelectNetworkManual start --" + plmn + " , " + act);
- await network.SelectNetworkManual(plmn, act);
- Log.Debug(Globals.LogTag, "SelectNetworkManual end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "SelectNetworkManual ,exception = " + ex.ToString());
- }
- }
-
- private async void SelectAutoNwBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "SelectNetworkAutomatic start");
- await network.SelectNetworkAutomatic();
- Log.Debug(Globals.LogTag, "SelectNetworkAutomatic end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "SelectNetworkAutomatic ,exception = " + ex.ToString());
- }
- }
-
- private async void GetServBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetNetworkServing start");
- NetworkServing serving = await network.GetNetworkServing();
- Log.Debug(Globals.LogTag, "GetNetworkServing , plmn = "+serving.Plmn + ",type = "+serving.SystemType);
- NetworkAreaInfo info = serving.AreaInfo;
- Log.Debug(Globals.LogTag, "areainfo , Lac = " + info.Lac);
- NetworkCdmaSysInfo cdmaInfo = info.CdmaInfo;
- if (cdmaInfo != null)
- {
- Log.Debug(Globals.LogTag, "cdmainfo, basestationid = " + cdmaInfo.BaseStationId + ",basestnlati= "+ cdmaInfo.BaseStationLatitude + ",basestnlongi= " + cdmaInfo.BaseStationLongitude+ ",carrier= " + cdmaInfo.Carrier +
- ",id= " + cdmaInfo.NetworkId + ",regzone= " + cdmaInfo.RegistrationZone + ",sysid= " + cdmaInfo.SystemId + ",offset= " + cdmaInfo.PilotOffset);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetNetworkServing ,exception = " + ex.ToString());
- }
- }
-
- private async void SetGetModeBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Set and get NetworkMode start");
- var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(NetworkMode)));
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- NetworkMode mode = (NetworkMode)Enum.Parse(typeof(NetworkMode), action);
- await network.SetNetworkMode(mode);
- NetworkMode curMode = await network.GetNetworkMode();
- if (curMode == mode)
- {
- Log.Debug(Globals.LogTag, "Set and get NetworkMode is success, currentmode = " + curMode);
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "Set and get NetworkMode has failed, currentmode = " + curMode + ", while the network mode was set to " +mode);
- }
- }
-
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Set and Get NetworkMode ,exception = " + ex.ToString());
- }
- }
-
- private async void GetNeighborBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "GetNeighborCellNetwork start");
- NetworkNeighboringCell cell = await network.GetNeighborCellNetwork();
- NetworkServingCell servcell = cell.ServingCell;
- List<NetworkGeranCell> geranlist = cell.GeranList.ToList();
- List<NetworkLteCell> ltelist = cell.LteList.ToList();
- List<NetworkUmtsCell> umtslist = cell.UmtsList.ToList();
- Log.Debug(Globals.LogTag, "NetworkServingCell, type = " + servcell.SystemType + ",mobilecountrycode = " + servcell.MobileCountryCode + ",mobilenetworkcode = " + servcell.MobileNetworkCode);
- global::Tizen.Tapi.Cell info = servcell.CellInfo;
- if (info != null)
- {
- Log.Debug(Globals.LogTag, "geraninfo, lac = " + info.GeranCell.Lac + ",cellid= " + info.GeranCell.CellId + ",bsic= " + info.GeranCell.Bsic +
- ",rxlev= " + info.GeranCell.Rxlev + ",bcch= " + info.GeranCell.Bcch);
- Log.Debug(Globals.LogTag, "lteinfo, earfcn = " + info.LteCell.Earfcn + ",cellid= " + info.LteCell.CellId + ",physicalid= " + info.LteCell.PhysicalId +
- ",rssi= " + info.LteCell.Rssi + ",tac = " + info.LteCell.Tac);
- Log.Debug(Globals.LogTag, "umtsinfo, arfcn = " + info.UmtsCell.Arfcn + ",cellid= " + info.UmtsCell.CellId + ",lac= " + info.UmtsCell.Lac +
- ",psc= " + info.UmtsCell.Psc + ",rscp= " + info.UmtsCell.Rscp);
- }
-
- foreach (NetworkGeranCell c in geranlist)
- {
- Log.Debug(Globals.LogTag, "geraninfo, lac = " + c.Lac + ",cellid= " + c.CellId + ",bsic= " + c.Bsic + ",rxlev= " + c.Rxlev + ",bcch= " + c.Bcch);
- }
- foreach (NetworkLteCell c in ltelist)
- {
- Log.Debug(Globals.LogTag, "lteinfo, earfcn = " + c.Earfcn + ",cellid= " + c.CellId + ",physicalid= " + c.PhysicalId +
- ",rssi= " + c.Rssi + ",tac = " + c.Tac);
- }
- foreach (NetworkUmtsCell c in umtslist)
- {
- Log.Debug(Globals.LogTag, "umtsinfo, arfcn = " + c.Arfcn + ",cellid= " + c.CellId + ",lac= " + c.Lac +
- ",psc= " + c.Psc + ",rscp= " + c.Rscp);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "GetNeighborCellNetwork ,exception = " + ex.ToString());
- }
- }
- private async void CancelSearchBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "CancelNetworkManualSearch start");
- await network.CancelNetworkManualSearch();
- Log.Debug(Globals.LogTag, "CancelNetworkManualSearch end");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "CancelNetworkManualSearch ,exception = " + ex.ToString());
- }
- }
-
- private async void SetEmergencyModeBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "SetEmergencyCallbackMode start");
- var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(NetworkEmergencyCallbackMode)));
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- NetworkEmergencyCallbackMode mode = (NetworkEmergencyCallbackMode)Enum.Parse(typeof(NetworkEmergencyCallbackMode), action);
- await network.SetEmergencyCallbackMode(mode);
- Log.Debug(Globals.LogTag, "SetEmergencyCallbackMode ends");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "SetEmergencyCallbackMode ,exception = " + ex.ToString());
- }
- }
- private async void SetGetRoamPrefBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Set and get roaming preference start");
- var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(NetworkPreferred)));
- Log.Debug(Globals.LogTag, "Action: " + action);
- if (action != null)
- {
- NetworkPreferred mode = (NetworkPreferred)Enum.Parse(typeof(NetworkPreferred), action);
- await network.SetRoamingPreference(mode);
- NetworkPreferred curMode = await network.GetRoamingPreference();
- if (curMode == mode)
- {
- Log.Debug(Globals.LogTag, "Set and get roaming preference is success, currentmode = " + curMode);
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "Set and get roaming preference has failed, currentmode = " + curMode + ", while the network mode was set to " + mode);
- }
- }
-
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Set and Get roaming preference ,exception = " + ex.ToString());
- }
- }
- private async void SetGetNwSubsBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Set and get default subscription start");
- await network.SetNetworkDefaultSubscription();
- NetworkDefaultSubscription subs = network.GetNetworkDefaultSubscription();
- Log.Debug(Globals.LogTag, "Set and get default subscription ends, Default subscription is = " + subs);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Set and get default subscription, exception = " + ex.ToString());
- }
- }
-
- private async void SetGetDataSubsBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Set and get default data subscription start");
- await network.SetDefaultDataSubscription();
- NetworkDefaultDataSubscription subs = network.GetDefaultDataSubscription();
- Log.Debug(Globals.LogTag, "Set and get default data subscription ends, Default subscription is = " + subs);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Set and get default data subscription, exception = " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using Xamarin.Forms;
-using Tizen;
-using Tizen.Tapi;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace XamarinForTizen.Tizen
-{
- public class PhonebookPage : ContentPage
- {
- Phonebook pb = null;
- TapiHandle handle = Globals.handleModem0;
- public PhonebookPage()
- {
- try
- {
- pb = new Phonebook(handle);
- handle.RegisterNotiEvent(Notification.PhonebookContactChange);
- handle.NotificationChanged += Handle_ContactChanged_NotiEvent;
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Pb constructor throws exception = " + ex.ToString());
- }
-
- var PhonebookInitInfoBtn = new Button
- {
- Text = "PhonebookInitInfo",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- PhonebookInitInfoBtn.Clicked += PhonebookInitInfoBtn_Clicked;
-
- var PhonebookStorageBtn = new Button
- {
- Text = "Get Phonebook Storage",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- PhonebookStorageBtn.Clicked += PhonebookStorageBtn_Clicked;
-
- var PhonebookMetaInfoBtn = new Button
- {
- Text = "Get Phonebook MetaInfo",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- PhonebookMetaInfoBtn.Clicked += PhonebookMetaInfoBtn_Clicked;
-
- var PhonebookMetaInfo3GBtn = new Button
- {
- Text = "Get Phonebook MetaInfo3G",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- PhonebookMetaInfo3GBtn.Clicked += PhonebookMetaInfo3GBtn_Clicked;
-
- var PhonebookReadRecordGBtn = new Button
- {
- Text = "Read Phonebook record",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- PhonebookReadRecordGBtn.Clicked += PhonebookReadRecordGBtn_Clicked;
-
- var PhonebookUpdateRecordGBtn = new Button
- {
- Text = "Update Phonebook record",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- PhonebookUpdateRecordGBtn.Clicked += PhonebookUpdateRecordGBtn_Clicked;
-
- var PhonebookDeleteRecordGBtn = new Button
- {
- Text = "Delete Phonebook record",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- PhonebookDeleteRecordGBtn.Clicked += PhonebookDeleteRecordGBtn_Clicked;
-
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- PhonebookInitInfoBtn, PhonebookStorageBtn, PhonebookMetaInfoBtn, PhonebookMetaInfo3GBtn,
- PhonebookReadRecordGBtn, PhonebookUpdateRecordGBtn, PhonebookDeleteRecordGBtn
- }
- };
- }
-
- private void Handle_ContactChanged_NotiEvent(object sender, NotificationChangedEventArgs e)
- {
- PhonebookContactChangeInfo info = (PhonebookContactChangeInfo)e.Data;
- Log.Debug(Globals.LogTag, "Pb contact change noti event received");
- Log.Debug(Globals.LogTag, "Pb Type: " + info.Type);
- Log.Debug(Globals.LogTag, "Pb index: " + info.Index);
- Log.Debug(Globals.LogTag, "Pb operation: " + info.Operation);
- }
-
- private async void PhonebookDeleteRecordGBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Pb delete record call start");
- bool b = await pb.DeletePhonebookRecord(PhonebookType.Usim, 1);
- if (b)
- {
- Log.Debug(Globals.LogTag, "Pb record deleted successfully");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Pb delete record exception: " + ex.ToString());
- }
- }
-
- private async void PhonebookUpdateRecordGBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Pb update record call start");
- PhonebookRecord pbRec = await pb.ReadPhonebookRecord(PhonebookType.Usim, 1);
- Log.Debug(Globals.LogTag, "Read record Index: " + pbRec.Index);
- Log.Debug(Globals.LogTag, "Read record Name: " + pbRec.Name);
- Log.Debug(Globals.LogTag, "Read record Number: " + pbRec.Number);
- PhonebookRecord rec = new PhonebookRecord();
- rec.Type = PhonebookType.Usim;
- rec.Index = 1;
- rec.Name = "NewName";
- rec.Number = "999999";
- bool b = await pb.UpdatePhonebookRecord(rec);
- if (b)
- {
- Log.Debug(Globals.LogTag, "Pb record updated successfully");
- }
-
- PhonebookRecord pbUpdt = await pb.ReadPhonebookRecord(PhonebookType.Usim, rec.Index);
- Log.Debug(Globals.LogTag, "Updated record Name: " + pbUpdt.Name);
- Log.Debug(Globals.LogTag, "Updated record Number: " + pbUpdt.Number);
- Log.Debug(Globals.LogTag, "Updated update record call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Pb update record exception: " + ex.ToString());
- }
- }
-
- private async void PhonebookReadRecordGBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Pb read record call start");
- PhonebookRecord pbRec = await pb.ReadPhonebookRecord(PhonebookType.Usim, 1);
- Log.Debug(Globals.LogTag, "Type: " + pbRec.Type);
- Log.Debug(Globals.LogTag, "Index: " + pbRec.Index);
- Log.Debug(Globals.LogTag, "NextIndex: " + pbRec.NextIndex);
- Log.Debug(Globals.LogTag, "Name: " + pbRec.Name);
- Log.Debug(Globals.LogTag, "Dcs: " + pbRec.Dcs);
- Log.Debug(Globals.LogTag, "Number: " + pbRec.Number);
- Log.Debug(Globals.LogTag, "Ton: " + pbRec.Ton);
- Log.Debug(Globals.LogTag, "Anr1: " + pbRec.Anr1);
- Log.Debug(Globals.LogTag, "Anr1Ton: " + pbRec.Anr1Ton);
- Log.Debug(Globals.LogTag, "Anr2: " + pbRec.Anr2);
- Log.Debug(Globals.LogTag, "Anr2Ton: " + pbRec.Anr2Ton);
- Log.Debug(Globals.LogTag, "Anr3: " + pbRec.Anr3);
- Log.Debug(Globals.LogTag, "Anr3Ton: " + pbRec.Anr3Ton);
- Log.Debug(Globals.LogTag, "Email1: " + pbRec.Email1);
- Log.Debug(Globals.LogTag, "Email2: " + pbRec.Email2);
- Log.Debug(Globals.LogTag, "Email3: " + pbRec.Email3);
- Log.Debug(Globals.LogTag, "Email4: " + pbRec.Email4);
- Log.Debug(Globals.LogTag, "Group index: " + pbRec.GroupIndex);
- Log.Debug(Globals.LogTag, "Pbcontrol: " + pbRec.PbControl);
-
- Log.Debug(Globals.LogTag, "Pb read record call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Pb read record exception: " + ex.ToString());
- }
- }
-
- private void PhonebookInitInfoBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Pb init info call start");
- SimPhonebookStatus pbStatus = pb.GetPhonebookInitInfo();
- if (pbStatus == null)
- {
- Log.Debug(Globals.LogTag, "pbStatus is null");
- return;
- }
-
- Log.Debug(Globals.LogTag, "pbStatus.isinitcompleted: " + pbStatus.IsInitCompleted);
- Log.Debug(Globals.LogTag, "pbStatus.pblist: " + pbStatus.PbList.Fdn + " " + pbStatus.PbList.Adn + " " + pbStatus.PbList.Sdn + " " + pbStatus.PbList.Usim + " " + pbStatus.PbList.Aas + " " + pbStatus.PbList.Gas);
- Log.Debug(Globals.LogTag, "Pb init info call success");
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Pb get init info exception: " + ex.ToString());
- }
- }
-
- private async void PhonebookMetaInfoBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Pb get meta info call start");
- foreach (PhonebookType type in Enum.GetValues(typeof(PhonebookType)))
- {
- if (type == PhonebookType.Unknown)
- {
- break;
- }
-
- PhonebookMetaInfo info = await pb.GetPhonebookMetaInfo(type);
- if (info == null)
- {
- Log.Debug(Globals.LogTag, "Pb meta info for " + type.ToString() + "is null");
- continue;
- }
-
- Log.Debug(Globals.LogTag, "Pb meta type for " + type.ToString() + ": " + info.Type);
- Log.Debug(Globals.LogTag, "Pb min index for " + type.ToString() + ": " + info.MinIndex);
- Log.Debug(Globals.LogTag, "Pb max index for " + type.ToString() + ": " + info.MaxIndex);
- Log.Debug(Globals.LogTag, "Pb max number length for " + type.ToString() + ": " + info.NumberMaxLength);
- Log.Debug(Globals.LogTag, "Pb max text length for " + type.ToString() + ": " + info.TextMaxLength);
- Log.Debug(Globals.LogTag, "Pb used count for " + type.ToString() + ": " + info.UsedCount);
- }
-
- Log.Debug(Globals.LogTag, "Pb get meta info success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Pb get meta info exception: " + ex.ToString());
- }
- }
-
- private async void PhonebookStorageBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- foreach (PhonebookType type in Enum.GetValues(typeof(PhonebookType)))
- {
- if (type == PhonebookType.Unknown)
- {
- break;
- }
-
- Log.Debug(Globals.LogTag, "Pb get storage start");
- PhonebookStorageInfo info = await pb.GetPhonebookStorage(type);
- Log.Debug(Globals.LogTag, "Pb get storage success");
- if (info == null)
- {
- Log.Debug(Globals.LogTag, "Pb storage info for " + type.ToString() + "is null");
- continue;
- }
-
- Log.Debug(Globals.LogTag, "Pb storage type for " + type.ToString() + ": " + info.Type);
- Log.Debug(Globals.LogTag, "Pb total record for " + type.ToString() + ": " + info.TotalRecord);
- Log.Debug(Globals.LogTag, "Pb used record for " + type.ToString() + ": " + info.UsedRecord);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Pb get storage info exception: " + ex.ToString());
- }
- }
-
- private async void PhonebookMetaInfo3GBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Pb get meta info 3G start");
- PhonebookMetaInfo3G info = await pb.GetPhonebookMetaInfo3G();
- Log.Debug(Globals.LogTag, "Pb get meta info 3G success");
- if (info == null)
- {
- Log.Debug(Globals.LogTag, "Pb meta info 3G is null");
- return;
- }
-
- Log.Debug(Globals.LogTag, "Pb file type count: " + info.FileTypeCount);
- List<FileTypeCapabilityInfo3G> infoList = new List<FileTypeCapabilityInfo3G>();
- if (infoList == null)
- {
- Log.Debug(Globals.LogTag, "File type info list is null");
- return;
- }
-
- infoList = info.FileTypeInfo.ToList();
- for (int i = 0; i < info.FileTypeCount; i++)
- {
- Log.Debug(Globals.LogTag, "capa.FileTypeInfo[" + i + "].FileType: " + infoList[i].FileType);
- Log.Debug(Globals.LogTag, "capa.FileTypeInfo[" + i + "].MaxIndex: " + infoList[i].MaxIndex);
- Log.Debug(Globals.LogTag, "capa.FileTypeInfo[" + i + "].TextMaxLength: " + infoList[i].TextMaxLength);
- Log.Debug(Globals.LogTag, "capa.FileTypeInfo[" + i + "].UsedCount: " + infoList[i].UsedCount);
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Pb get meta info 3G exception: " + ex.ToString());
- }
- }
-
- ~PhonebookPage()
- {
- handle.DeregisterNotiEvent(Notification.PhonebookContactChange);
- handle.NotificationChanged -= Handle_ContactChanged_NotiEvent;
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-using Xamarin.Forms;
-using Tizen;
-using Tizen.System;
-using Tizen.Tapi;
-
-namespace XamarinForTizen.Tizen
-{
- internal class Globals
- {
- internal static string LogTag = "Tapitest";
-
- internal static TapiHandle handleModem0 = null;
- internal static TapiHandle handleModem1 = null;
- }
- public class App : Application
- {
- private static bool s_isTapiSupported = false;
- public App()
- {
- SystemInfo.TryGetValue("http://tizen.org/feature/network.telephony", out s_isTapiSupported);
- if (s_isTapiSupported)
- {
- Log.Debug(Globals.LogTag, "tapi feature check = " + s_isTapiSupported);
- MainPage = new NavigationPage(new MainPage());
- }
-
- else
- {
- Log.Debug(Globals.LogTag, "tapi feature is not supported");
- }
- }
-
- protected override void OnStart()
- {
- // Handle when your app starts
- }
-
- protected override void OnSleep()
- {
- // Handle when your app sleeps
- }
-
- protected override void OnResume()
- {
- // Handle when your app resumes
- }
- }
-
- class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
- {
- private static App _app;
- protected override void OnCreate()
- {
- base.OnCreate();
-
- Log.Debug(Globals.LogTag, "OnCreate()");
- _app = new App();
- LoadApplication(_app);
- }
-
- public static App getApp()
- {
- return _app;
- }
- static void Main(string[] args)
- {
- Log.Debug(Globals.LogTag, "inside main");
- var app = new Program();
- global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
- app.Run(args);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Tizen.Tapitest")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Samsung Electronics")]
-[assembly: AssemblyProduct("Tizen.Tapitest")]
-[assembly: AssemblyCopyright("Copyright © Samsung Electronics 2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("F2650ABF-4EC2-42A2-AF37-43216A3AC15E")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+++ /dev/null
-using System;
-using Xamarin.Forms;
-using Tizen;
-using Tizen.Tapi;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace XamarinForTizen.Tizen
-{
- public class SimPage : ContentPage
- {
- Sim sim = null;
- public SimPage()
- {
- try
- {
- sim = new Sim(Globals.handleModem0);
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim constructor throws exception = " + ex.ToString());
- }
-
- var SimInitInfoBtn = new Button
- {
- Text = "SimInitInfo",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- SimInitInfoBtn.Clicked += SimInitInfoBtn_Clicked;
-
- var SimPropertiesBtn = new Button
- {
- Text = "Get sim properties(Type, Imsi, Ecc)",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- SimPropertiesBtn.Clicked += SimPropertiesBtn_Clicked;
-
- var appListBtn = new Button
- {
- Text = "Get sim application list",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- appListBtn.Clicked += appListBtn_Clicked;
-
- var iccIdBtn = new Button
- {
- Text = "Get sim ICCID",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- iccIdBtn.Clicked += iccIdBtn_Clicked;
-
- var langPrefBtn = new Button
- {
- Text = "Set & get sim language preference",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- langPrefBtn.Clicked += langPrefBtn_Clicked;
-
- var getCfBtn = new Button
- {
- Text = "Get call forward info",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getCfBtn.Clicked += getCfBtn_Clicked;
-
- var getMwBtn = new Button
- {
- Text = "Get message waiting info",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getMwBtn.Clicked += getMwBtn_Clicked;
-
- var getMbBtn = new Button
- {
- Text = "Get mailbox info",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getMbBtn.Clicked += getMbBtn_Clicked;
-
- var getCphsBtn = new Button
- {
- Text = "Get CPHS info",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getCphsBtn.Clicked += getCphsBtn_Clicked;
-
- var getCphsNetNameBtn = new Button
- {
- Text = "Get CPHS operator name",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getCphsNetNameBtn.Clicked += getCphsNetNameBtn_Clicked;
-
- var getFacilityBtn = new Button
- {
- Text = "Get sim facility",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getFacilityBtn.Clicked += getFacilityBtn_Clicked;
-
- var getLockInfoBtn = new Button
- {
- Text = "Get sim lock status",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getLockInfoBtn.Clicked += getLockInfoBtn_Clicked;
-
- var getImpiBtn = new Button
- {
- Text = "Get sim IMPI",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getImpiBtn.Clicked += getImpiBtn_Clicked;
-
- var getImpuBtn = new Button
- {
- Text = "Get sim IMPU",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getImpuBtn.Clicked += getImpuBtn_Clicked;
-
- var getDomainBtn = new Button
- {
- Text = "Get sim domain",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getDomainBtn.Clicked += getDomainBtn_Clicked;
-
- var getPcscfBtn = new Button
- {
- Text = "Get sim P-CSCF",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getPcscfBtn.Clicked += getPcscfBtn_Clicked;
-
- var getIsimSvcTableBtn = new Button
- {
- Text = "Get ISIM service table",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getIsimSvcTableBtn.Clicked += getIsimSvcTableBtn_Clicked;
-
- var msisdnBtn = new Button
- {
- Text = "Get sim MSISDN",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- msisdnBtn.Clicked += msisdnBtn_Clicked;
-
- var oplmnwactBtn = new Button
- {
- Text = "Get sim OPLMNWACT",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- oplmnwactBtn.Clicked += oplmnwactBtn_Clicked;
-
- var spnBtn = new Button
- {
- Text = "Get sim SPN",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- spnBtn.Clicked += spnBtn_Clicked;
-
- var autnBtn = new Button
- {
- Text = "Sim authentication",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- autnBtn.Clicked += autnBtn_Clicked;
-
- var powerBtn = new Button
- {
- Text = "Sim change power state",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- powerBtn.Clicked += powerBtn_Clicked;
-
- var apduBtn = new Button
- {
- Text = "Sim APDU",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- apduBtn.Clicked += apduBtn_Clicked;
-
- var atrBtn = new Button
- {
- Text = "Sim ATR",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- atrBtn.Clicked += atrBtn_Clicked;
-
- ScrollView scrollView = new ScrollView()
- {
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- SimInitInfoBtn, SimPropertiesBtn, appListBtn, iccIdBtn, langPrefBtn, getCfBtn, getCphsBtn, getMbBtn,
- getMwBtn, getCphsNetNameBtn, getFacilityBtn, getLockInfoBtn, getImpiBtn, getImpuBtn, getDomainBtn,
- getPcscfBtn, getIsimSvcTableBtn, msisdnBtn, oplmnwactBtn, spnBtn, autnBtn, powerBtn, apduBtn, atrBtn
- }
- },
- VerticalOptions = LayoutOptions.Center
- };
- Content = scrollView;
- }
-
- private async void atrBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim request ATR call start");
- SimAtrResponse resp = await sim.SimRequestAtr();
- Log.Debug(Globals.LogTag, "Atr response length: " + resp.AtrRespLength);
- for (int i = 0; i < resp.AtrRespLength; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "]'s byte: [0x" + resp.AtrResponse[i] + "]");
- }
-
- Log.Debug(Globals.LogTag, "Sim request ATR call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim request ATR exception: " + ex.ToString());
- }
- }
-
- private async void apduBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim request APDU call start");
- SimApdu apdu = new SimApdu(Encoding.ASCII.GetBytes("0070000000"));
- SimApduResponse resp = await sim.SimRequestApdu(apdu);
- Log.Debug(Globals.LogTag, "Apdu response length: " + resp.ApduLength);
- for (int i = 0; i < resp.ApduLength; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "]'s byte: [0x" + resp.ApduResponse[i] + "]");
- }
-
- Log.Debug(Globals.LogTag, "Sim request APDU call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim request APDU exception: " + ex.ToString());
- }
- }
-
- private async void powerBtn_Clicked(object sender, EventArgs e)
- {
- TapiHandle handle = Globals.handleModem0;
- try
- {
- Log.Debug(Globals.LogTag, "Sim set power state call start");
- handle.NotificationChanged += Handle_NotiPowerStateChanged;
- handle.RegisterNotiEvent(Notification.SimStatus);
- bool state = await sim.SimSetPowerState(SimPowerState.Off);
- if (state)
- {
- await sim.SimSetPowerState(SimPowerState.On);
- }
-
- Log.Debug(Globals.LogTag, "Sim set power state call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim set power state exception: " + ex.ToString());
- }
-
- finally
- {
- handle.DeregisterNotiEvent(Notification.SimStatus);
- handle.NotificationChanged -= Handle_NotiPowerStateChanged;
- }
- }
-
- private void Handle_NotiPowerStateChanged(object sender, NotificationChangedEventArgs e)
- {
- Log.Debug(Globals.LogTag, "Sim status noti event received, Status: " + e.Data + " Noti value: " + e.Id);
- }
-
- private async void autnBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- SimAuthenticationData authData = new SimAuthenticationData(SimAuthenticationType.Auth3G, 4, 4, Encoding.ASCII.GetBytes("qwerty"), Encoding.ASCII.GetBytes("asdf"));
- Log.Debug(Globals.LogTag, "Sim execute authentication call start");
- SimAuthenticationResponse authResp = await sim.SimExecuteAuthentication(authData);
- Log.Debug(Globals.LogTag, "Response auth type: " + authResp.AuthType);
- Log.Debug(Globals.LogTag, "Response auth result: " + authResp.AuthResult);
- Log.Debug(Globals.LogTag, "Response data: " + authResp.ResponseData);
- Log.Debug(Globals.LogTag, "Auth key: " + authResp.AuthKey);
- Log.Debug(Globals.LogTag, "Cipher data: " + authResp.CipherData);
- Log.Debug(Globals.LogTag, "Integrity data: " + authResp.IntegrityData);
- Log.Debug(Globals.LogTag, "Sim execute authentication call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get SPN exception: " + ex.ToString());
- }
- }
-
- private async void spnBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get SPN call start");
- SimSpn spn = await sim.SimGetSpn();
- Log.Debug(Globals.LogTag, "SPN display condition: " + spn.DisplayCondition);
- Log.Debug(Globals.LogTag, "SPN name: " + spn.Spn);
- Log.Debug(Globals.LogTag, "Sim get SPN call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get SPN exception: " + ex.ToString());
- }
- }
-
- private async void oplmnwactBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get oplmnwact call start");
- SimOplmnwactList oplmnwact = await sim.SimGetOplmnwact();
- Log.Debug(Globals.LogTag, "Sim OPLMNWACT count: " + oplmnwact.Count);
- List<SimOplmnwact> oplmnList = oplmnwact.List.ToList();
- for (int i = 0; i < oplmnwact.Count; i++)
- {
- Log.Debug(Globals.LogTag, "Oplmn.list[" + i + "].Plmn: " + oplmnList[i].Plmn);
- Log.Debug(Globals.LogTag, "Oplmn.list[" + i + "].IsUmt: " + oplmnList[i].IsUmts);
- Log.Debug(Globals.LogTag, "Oplmn.list[" + i + "].IsGsm: " + oplmnList[i].IsGsm);
- }
-
- Log.Debug(Globals.LogTag, "Sim get oplmnwact call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get oplmnwact exception: " + ex.ToString());
- }
- }
-
- private async void msisdnBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get msisdn call start");
- SimMsisdnList msisdn = await sim.SimGetMsisdn();
- Log.Debug(Globals.LogTag, "Sim MSISDN count: " + msisdn.Count);
- List<SimSubscriberInfo> subs = msisdn.List.ToList();
- for (int i = 0; i < msisdn.Count; i++)
- {
- Log.Debug(Globals.LogTag, "Msisdn.list[" + i + "].Number: " + subs[i].Number);
- Log.Debug(Globals.LogTag, "Msisdn.list[" + i + "].Name: " +subs[i].Name);
- }
-
- Log.Debug(Globals.LogTag, "Sim get msisdn call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get msisdn exception: " + ex.ToString());
- }
- }
-
- private async void getIsimSvcTableBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get ISIM service table start");
- Log.Debug(Globals.LogTag, "ISIM service: " + Encoding.UTF8.GetString(await sim.SimGetIsimServiceTable()));
- Log.Debug(Globals.LogTag, "Sim get ISIM service table success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get ISIM service table exception: " + ex.ToString());
- }
- }
-
- private async void getPcscfBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get P-CSCF start");
- SimPcscfList pcsf = await sim.SimGetPcscf();
- Log.Debug(Globals.LogTag, "Data count: " + pcsf.Count);
- List<SimPcscf> list = pcsf.List.ToList();
- for (int i = 0; i < pcsf.Count; i++)
- {
- Log.Debug(Globals.LogTag, "PcscfList[" + i + "].Type: " + list[i].Type);
- Log.Debug(Globals.LogTag, "PcscfList[" + i + "].Data: " + list[i].Pcscf);
- }
-
- Log.Debug(Globals.LogTag, "Sim get P-CSCF success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get P-CSCF exception: " + ex.ToString());
- }
- }
-
- private async void getDomainBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get domain start");
- Log.Debug(Globals.LogTag, "Domain: " + await sim.SimGetDomain());
- Log.Debug(Globals.LogTag, "Sim get domain success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get domain exception: " + ex.ToString());
- }
- }
-
- private async void getImpuBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get IMPU start");
- SimImpuList impu = await sim.SimGetImpu();
- Log.Debug(Globals.LogTag, "Data count: " + impu.Count);
- List<string> list = impu.List.ToList();
- for (int i = 0; i < impu.Count; i++)
- {
- Log.Debug(Globals.LogTag, "Data count[" + i + "]: " + list[i]);
- }
-
- Log.Debug(Globals.LogTag, "Sim get IMPU success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get IMPU exception: " + ex.ToString());
- }
- }
-
- private async void getImpiBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get IMPI start");
- string impi = await sim.SimGetImpi();
- Log.Debug(Globals.LogTag, "IMPI: " + impi);
- Log.Debug(Globals.LogTag, "Sim get IMPI success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get IMPI exception: " + ex.ToString());
- }
- }
-
- private async void getLockInfoBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get lock status start");
- SimLockInfo info = await sim.SimGetLockInfo(SimLockType.PS);
- Log.Debug(Globals.LogTag, "Lock type: " + info.Type);
- Log.Debug(Globals.LogTag, "Status: " + info.Status);
- Log.Debug(Globals.LogTag, "Retry counts: " + info.RetryCount);
- Log.Debug(Globals.LogTag, "Sim get lock status success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get lock status exception: " + ex.ToString());
- }
- }
-
- private async void getFacilityBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get facility start");
- SimFacilityInfo info = await sim.SimGetFacility(SimLockType.PS);
- Log.Debug(Globals.LogTag, "Lock type: " + info.Type);
- Log.Debug(Globals.LogTag, "Status: " + info.Status);
- Log.Debug(Globals.LogTag, "Sim get facility success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get facility exception: " + ex.ToString());
- }
- }
-
- private async void getCphsNetNameBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get CPHS net name start");
- SimCphsNetName name = await sim.SimGetCphsNetName();
- Log.Debug(Globals.LogTag, "Full name: " + name.FullName);
- Log.Debug(Globals.LogTag, "Short name: " + name.ShortName);
- Log.Debug(Globals.LogTag, "Sim get CPHS net name success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get CPHS net name exception: " + ex.ToString());
- }
- }
-
- private async void getCphsBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get CPHS info start");
- SimCphsInfo info = await sim.SimGetCphsInfo();
- Log.Debug(Globals.LogTag, "CPHS phase: " + info.CphsPhase);
- Log.Debug(Globals.LogTag, "CPHS CSP: " + info.CphsServiceTable.CustomerServiceProfile);
- Log.Debug(Globals.LogTag, "CPHS SST: " + info.CphsServiceTable.ServiceStringTable);
- Log.Debug(Globals.LogTag, "CPHS Mailboxnumbers: " + info.CphsServiceTable.MailboxNumbers);
- Log.Debug(Globals.LogTag, "CPHS Operator short form name: " + info.CphsServiceTable.OperatorNameShortForm);
- Log.Debug(Globals.LogTag, "CPHS information numbers: " + info.CphsServiceTable.InformationNumbers);
- Log.Debug(Globals.LogTag, "Sim get CPHS info success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get CPHS info exception: " + ex.ToString());
- }
- }
-
- private async void getMbBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get mailbox info start");
- SimMailboxList mbList = await sim.SimGetMailboxInfo();
- Log.Debug(Globals.LogTag, "Mb count: " + mbList.Count);
- List<SimMailboxNumber> list = mbList.List.ToList();
- for (int i = 0; i < mbList.Count; i++)
- {
- Log.Debug(Globals.LogTag, "MbList[" + i + "].IsCphs: " + list[i].IsCphs);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].RecIndex: " + list[i].RecIndex);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].ProfileNumber: " + list[i].ProfileNumber);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].MbType: " + list[i].MbType);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].AlphaMaxLength: " + list[i].AlphaMaxLength);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].AlphaId: " + list[i].AlphaId);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].Ton: " + list[i].Ton);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].Npi: " + list[i].Npi);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].Number: " + list[i].Number);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].CcId: " + list[i].CcId);
- Log.Debug(Globals.LogTag, "MbList[" + i + "].Ext1Id: " + list[i].Ext1Id);
- }
-
- Log.Debug(Globals.LogTag, "Sim get mailbox info success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get mailbox info exception: " + ex.ToString());
- }
- }
-
- private async void getMwBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get message waiting info start");
- SimMessageWaitingResponse resp = await sim.SimGetMessageWaitingInfo();
- Log.Debug(Globals.LogTag, "Is CPHS: " + resp.IsCphs);
- Log.Debug(Globals.LogTag, "MWIS profile count: " + resp.MwList.ProfileCount);
- List<SimMwis> mwis = resp.MwList.MwList.ToList();
- for (int i = 0; i < resp.MwList.ProfileCount; i++)
- {
- Log.Debug(Globals.LogTag, "MWisList[" + i + "].RecIndex: " + mwis[i].RecIndex);
- Log.Debug(Globals.LogTag, "MWisList[" + i + "].IndicatorStatus: " + mwis[i].IndicatorStatus);
- Log.Debug(Globals.LogTag, "MWisList[" + i + "].VoiceCount: " + mwis[i].VoiceCount);
- Log.Debug(Globals.LogTag, "MWisList[" + i + "].FaxCount: " + mwis[i].FaxCount);
- Log.Debug(Globals.LogTag, "MWisList[" + i + "].EmailCount: " + mwis[i].EmailCount);
- Log.Debug(Globals.LogTag, "MWisList[" + i + "].OtherCount: " + mwis[i].OtherCount);
- Log.Debug(Globals.LogTag, "MWisList[" + i + "].VideoCount: " + mwis[i].VideoCount);
- }
-
- Log.Debug(Globals.LogTag, "CPHSMW.Voice1: " + resp.CphsMw.IsVoice1);
- Log.Debug(Globals.LogTag, "CPHSMW.Voice2: " + resp.CphsMw.IsVoice2);
- Log.Debug(Globals.LogTag, "CPHSMW.Fax: " + resp.CphsMw.IsFax);
- Log.Debug(Globals.LogTag, "CPHSMW.Data: " + resp.CphsMw.IsData);
- Log.Debug(Globals.LogTag, "Sim get message waiting info success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get message waiting info exception: " + ex.ToString());
- }
- }
-
- private async void getCfBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get call forward info start");
- SimCallForwardResponse resp = await sim.SimGetCallForwardInfo();
- Log.Debug(Globals.LogTag, "Is CPHS: " + resp.IsCphs);
- Log.Debug(Globals.LogTag, "CFIS profile count: " + resp.CfList.ProfileCount);
- List<SimCfis> cfis = resp.CfList.CfisList.ToList();
- for (int i = 0; i < resp.CfList.ProfileCount; i++)
- {
- Log.Debug(Globals.LogTag, "CfisList[" + i + "].RecIndex: " + cfis[i].RecIndex);
- Log.Debug(Globals.LogTag, "CfisList[" + i + "].MspNum: " + cfis[i].MspNum);
- Log.Debug(Globals.LogTag, "CfisList[" + i + "].CfuStatus: " + cfis[i].CfuStatus);
- Log.Debug(Globals.LogTag, "CfisList[" + i + "].Ton: " + cfis[i].Ton);
- Log.Debug(Globals.LogTag, "CfisList[" + i + "].Npi: " + cfis[i].Npi);
- Log.Debug(Globals.LogTag, "CfisList[" + i + "].CfuNum: " + cfis[i].CfuNum);
- Log.Debug(Globals.LogTag, "CfisList[" + i + "].Cc2Id: " + cfis[i].Cc2Id);
- Log.Debug(Globals.LogTag, "CfisList[" + i + "].Ext7Id: " + cfis[i].Ext7Id);
- }
-
- Log.Debug(Globals.LogTag, "CPHSCF.Line1: " + resp.CphsCf.Line1);
- Log.Debug(Globals.LogTag, "CPHSCF.Line2: " + resp.CphsCf.Line2);
- Log.Debug(Globals.LogTag, "CPHSCF.Fax: " + resp.CphsCf.Fax);
- Log.Debug(Globals.LogTag, "CPHSCF.Data: " + resp.CphsCf.Data);
- Log.Debug(Globals.LogTag, "Sim get call forward info success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get call forward info exception: " + ex.ToString());
- }
- }
-
- private async void langPrefBtn_Clicked(object sender, EventArgs e)
- {
- SimLanguagePreference current = await sim.SimGetLanguagePreference();
- try
- {
- Log.Debug(Globals.LogTag, "Sim get language preference call start");
- foreach (SimLanguagePreference pref in Enum.GetValues(typeof(SimLanguagePreference)))
- {
- if (pref == SimLanguagePreference.Unspecified)
- {
- break;
- }
-
- Log.Debug(Globals.LogTag, "Setting sim language preference with " + pref);
- bool setFlag = await sim.SimSetLanguagePreference(pref);
- if (setFlag)
- {
- Log.Debug(Globals.LogTag, "Current sim language preference: " + await sim.SimGetLanguagePreference());
- }
- }
-
- Log.Debug(Globals.LogTag, "Sim get language preference call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get language preference exception: " + ex.ToString());
- }
-
- finally
- {
- await sim.SimSetLanguagePreference(current);
- }
- }
-
- private async void iccIdBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get ICC ID call start");
- SimIccIdInfo info = await sim.SimGetIccId();
- if (info == null)
- {
- Log.Debug(Globals.LogTag, "Sim icc id info is null");
- return;
- }
-
- Log.Debug(Globals.LogTag, "Sim ICC ID length: " + info.IccLength);
- Log.Debug(Globals.LogTag, "Sim ICC ID: " + info.IccNumber);
- Log.Debug(Globals.LogTag, "Sim get ICC ID call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get ICC ID exception: " + ex.ToString());
- }
- }
-
- private void appListBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim get app list call start");
- byte app = sim.SimGetApplicationList();
- Log.Debug(Globals.LogTag, "Sim app list: " + app);
- if ((app & (byte)SimAppType.Sim) != 0)
- {
- Log.Debug(Globals.LogTag, "[SIM]");
- }
-
- if ((app & (byte)SimAppType.Usim) != 0)
- {
- Log.Debug(Globals.LogTag, "[USIM]");
- }
-
- if ((app & (byte)SimAppType.Csim) != 0)
- {
- Log.Debug(Globals.LogTag, "[CSIM]");
- }
-
- if ((app & (byte)SimAppType.Isim) != 0)
- {
- Log.Debug(Globals.LogTag, "[ISIM]");
- }
-
- Log.Debug(Globals.LogTag, "Sim get app list call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get app list exception: " + ex.ToString());
- }
- }
-
- private void SimPropertiesBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim type call start");
- Log.Debug(Globals.LogTag, "Sim card type: " + sim.SimType);
- Log.Debug(Globals.LogTag, "Sim type call success");
-
- Log.Debug(Globals.LogTag, "Sim imsi info call start");
- SimImsiInfo imsi = sim.Imsi;
- if (imsi == null)
- {
- Log.Debug(Globals.LogTag, "Imsi info is null");
- return;
- }
-
- Log.Debug(Globals.LogTag, "Sim Mcc: " + imsi.Mcc);
- Log.Debug(Globals.LogTag, "Sim Mnc: " + imsi.Mnc);
- Log.Debug(Globals.LogTag, "Sim Msin: " + imsi.Msin);
- Log.Debug(Globals.LogTag, "Sim imsi info call success");
-
- Log.Debug(Globals.LogTag, "Sim ecc info call start");
- SimEccInfoList eccList = sim.Ecc;
- Log.Debug(Globals.LogTag, "Sim ECC count: " + eccList.Count);
- List<SimEccInfo> ecc = eccList.EccList.ToList();
- for (int i = 0; i < eccList.Count; i++)
- {
- Log.Debug(Globals.LogTag, "EccList.list[" + i + "].Name: " + ecc[i].Name);
- Log.Debug(Globals.LogTag, "EccList.list[" + i + "].Number: " + ecc[i].Number);
- Log.Debug(Globals.LogTag, "EccList.list[" + i + "].Category: " + ecc[i].Category);
- }
-
- Log.Debug(Globals.LogTag, "Sim ecc info call success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim get properties exception: " + ex.ToString());
- }
- }
-
- private void SimInitInfoBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Sim init info call start");
- SimInitInfo info = sim.InitInfo;
- if (info == null)
- {
- Log.Debug(Globals.LogTag, "Sim init info is null");
- return;
- }
-
- Log.Debug(Globals.LogTag, "Sim status: " + info.Status);
- Log.Debug(Globals.LogTag, "Sim card changed flag: " + info.IsCardChanged);
- Log.Debug(Globals.LogTag, "Sim init info call success");
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Sim init info exception: " + ex.ToString());
- }
- }
- }
-}
+++ /dev/null
-using System;
-using Xamarin.Forms;
-using Tizen;
-using Tizen.Tapi;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace XamarinForTizen.Tizen
-{
- public class SsPage : ContentPage
- {
- Ss ss = null;
- public SsPage()
- {
- try
- {
- ss = new Ss(Globals.handleModem0);
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss constructor throws exception = " + ex.ToString());
- }
-
- var setCfBtn = new Button
- {
- Text = "Set SS call forward",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- setCfBtn.Clicked += setCfBtn_Clicked;
-
- var getCfBtn = new Button
- {
- Text = "Get SS call forward status",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getCfBtn.Clicked += getCfBtn_Clicked;
-
- var setcwBtn = new Button
- {
- Text = "Set SS call waiting",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- setcwBtn.Clicked += setcwBtn_Clicked;
-
- var getcwBtn = new Button
- {
- Text = "Get SS call waiting status",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getcwBtn.Clicked += getcwBtn_Clicked;
-
- var setCliBtn = new Button
- {
- Text = "Set SS CLI status",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- setCliBtn.Clicked += setCliBtn_Clicked;
-
- var getCliBtn = new Button
- {
- Text = "Get SS CLI status",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getCliBtn.Clicked += getCliBtn_Clicked;
-
- var setBarringBtn = new Button
- {
- Text = "Set SS barring",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- setBarringBtn.Clicked += setBarringBtn_Clicked;
-
- var getBarringBtn = new Button
- {
- Text = "Get SS barring status",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- getBarringBtn.Clicked += getBarringBtn_Clicked;
-
- var changeBarringPwBtn = new Button
- {
- Text = "Change SS barring password",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- changeBarringPwBtn.Clicked += changeBarringPwBtn_Clicked;
-
- var sendUssdBtn = new Button
- {
- Text = "Ss send USSD request",
- VerticalOptions = LayoutOptions.Start,
- HorizontalOptions = LayoutOptions.FillAndExpand
- };
- sendUssdBtn.Clicked += sendUssdBtn_Clicked;
-
- Content = new StackLayout
- {
- VerticalOptions = LayoutOptions.Center,
- Children = {
- setCfBtn, getCfBtn, setcwBtn, getcwBtn, setCliBtn, getCliBtn, setBarringBtn, getBarringBtn,
- changeBarringPwBtn, sendUssdBtn
- }
- };
- }
-
- private async void sendUssdBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Ss send ussd request start");
- SsUssdMsgInfo info = new SsUssdMsgInfo();
- info.Type = SsUssdType.UserInit;
- info.UssdString = "*123#";
- info.Length = info.UssdString.Length;
- SsUssdResponse resp = await ss.SsSendUssdRequest(info);
- Log.Debug(Globals.LogTag, "Type: " + resp.Type);
- Log.Debug(Globals.LogTag, "String: " + resp.UssdString);
- Log.Debug(Globals.LogTag, "Ss send ussd request success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss send ussd request exception: " + ex.ToString());
- }
- }
-
- private async void changeBarringPwBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Ss change barring password start");
- bool b = await ss.SsChangeBarringPassword("1111", "'1234", "1234");
- if (b)
- {
- Log.Debug(Globals.LogTag, "Ss barring password changed successfully");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss change barring password exception: " + ex.ToString());
- }
- }
-
- private async void getBarringBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Ss get barring status start");
- SsBarringResponse resp = await ss.SsGetBarringStatus(SsClass.AllTele, SsBarringType.Aob);
- Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber);
- List<SsBarringRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Type: " + rec[i].BarringType);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- }
-
- Log.Debug(Globals.LogTag, "Ss get barring status success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss set barring exception: " + ex.ToString());
- }
- }
-
- private async void setBarringBtn_Clicked(object sender, EventArgs e)
- {
- TapiHandle handle = Globals.handleModem0;
- try
- {
- Log.Debug(Globals.LogTag, "Ss set barring start");
- handle.RegisterNotiEvent(Notification.SsNotifyBarring);
- handle.NotificationChanged += Handle_Barring_NotiEvent;
- SsBarringInfo info = new SsBarringInfo(SsClass.Voice, SsBarringMode.Activate, SsBarringType.Aob, "0000");
- SsBarringResponse resp = await ss.SsSetBarring(info);
- Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber);
- List<SsBarringRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Type: " + rec[i].BarringType);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- }
-
- Log.Debug(Globals.LogTag, "Ss set barring success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss set barring exception: " + ex.ToString());
- }
-
- finally
- {
- handle.DeregisterNotiEvent(Notification.SsNotifyBarring);
- handle.NotificationChanged -= Handle_Barring_NotiEvent;
- }
- }
-
- private void Handle_Barring_NotiEvent(object sender, NotificationChangedEventArgs e)
- {
- Log.Debug(Globals.LogTag, "Ss barring noti event received");
- SsBarringResponse resp = (SsBarringResponse)e.Data;
- Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber);
- List<SsBarringRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Type: " + rec[i].BarringType);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- }
- }
-
- private async void getCliBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Ss get CLI status start");
- SsCliResponse resp = await ss.SsGetCliStatus(SsCliType.Clip);
- Log.Debug(Globals.LogTag, "Type: " + resp.Type);
- Log.Debug(Globals.LogTag, "Status: " + resp.Status);
- Log.Debug(Globals.LogTag, "Ss get CLI status success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss get CLI status exception: " + ex.ToString());
- }
- }
-
- private async void setCliBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Ss set CLI start");
- bool b = await ss.SsSetCliStatus(SsCliType.Clip, SsCliStatus.Activated);
- if (b)
- {
- Log.Debug(Globals.LogTag, "Ss set CLI status is success");
- }
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss set CLI exception: " + ex.ToString());
- }
- }
-
- private async void getcwBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Ss get call waiting start");
- SsWaitingResponse resp = await ss.SsGetWaitingInfo(SsClass.Voice);
- Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber);
- List<SsWaitingRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- }
-
- Log.Debug(Globals.LogTag, "Ss get call waiting success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss get call waiting exception: " + ex.ToString());
- }
- }
-
- private async void setcwBtn_Clicked(object sender, EventArgs e)
- {
- TapiHandle handle = Globals.handleModem0;
- try
- {
- Log.Debug(Globals.LogTag, "Ss set call waiting start");
- handle.RegisterNotiEvent(Notification.SsNotifyWaiting);
- handle.NotificationChanged += Handle_CallWaitingNoti;
- SsWaitingInfo info = new SsWaitingInfo(SsClass.Voice, SsCallWaitingMode.Activate);
- SsWaitingResponse resp = await ss.SsSetWaitingInfo(info);
- Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber);
- List<SsWaitingRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- }
-
- Log.Debug(Globals.LogTag, "Ss set call waiting success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss set call waiting exception: " + ex.ToString());
- }
-
- finally
- {
- handle.DeregisterNotiEvent(Notification.SsNotifyWaiting);
- handle.NotificationChanged -= Handle_CallWaitingNoti;
- }
- }
-
- private void Handle_CallWaitingNoti(object sender, NotificationChangedEventArgs e)
- {
- Log.Debug(Globals.LogTag, "Ss call waiting noti event is received");
- SsWaitingResponse resp = (SsWaitingResponse)e.Data;
- Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber);
- List<SsWaitingRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- }
- }
-
- private async void getCfBtn_Clicked(object sender, EventArgs e)
- {
- try
- {
- Log.Debug(Globals.LogTag, "Ss get call forward start");
- SsForwardResponse resp = await ss.SsGetForwardStatus(SsClass.Voice, SsForwardCondition.NotReachable);
- Log.Debug(Globals.LogTag, "Record num: " + resp.RecordNumber);
- List<SsForwardRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- Log.Debug(Globals.LogTag, "[" + i + "] ForwardCondition: " + rec[i].ForwardCondition);
- Log.Debug(Globals.LogTag, "[" + i + "] IsFwNumPresent: " + rec[i].IsForwardingNumberPresent);
- Log.Debug(Globals.LogTag, "[" + i + "] NoReplyTime:: " + rec[i].NoReplyTime);
- Log.Debug(Globals.LogTag, "[" + i + "] Ton: " + rec[i].Ton);
- Log.Debug(Globals.LogTag, "[" + i + "] Npi: " + rec[i].Npi);
- Log.Debug(Globals.LogTag, "[" + i + "] Number: " + rec[i].ForwardingNumber);
- }
-
- Log.Debug(Globals.LogTag, "Ss get call forward success");
- }
-
- catch (Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss get call forward exception: " + ex.ToString());
- }
- }
-
- private async void setCfBtn_Clicked(object sender, EventArgs e)
- {
- TapiHandle handle = Globals.handleModem0;
- try
- {
- Log.Debug(Globals.LogTag, "Ss set call forward start");
- handle.RegisterNotiEvent(Notification.SsNotifyForwarding);
- handle.NotificationChanged += Handle_CallForwardNotiEvent;
- SsForwardInfo cfInfo = new SsForwardInfo(SsClass.Voice, SsForwardMode.Enable, SsForwardCondition.NotReachable, SsNoReplyTime.Time5Secs, SsForwardTypeOfNumber.National, SsForwardNumberingPlanIdentity.National, "9589874552");
- SsForwardResponse resp = await ss.SsSetForwardInfo(cfInfo);
- Log.Debug(Globals.LogTag, "Record num: " + resp.RecordNumber);
- List<SsForwardRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- Log.Debug(Globals.LogTag, "[" + i + "] ForwardCondition: " + rec[i].ForwardCondition);
- Log.Debug(Globals.LogTag, "[" + i + "] IsFwNumPresent: " + rec[i].IsForwardingNumberPresent);
- Log.Debug(Globals.LogTag, "[" + i + "] NoReplyTime:: " + rec[i].NoReplyTime);
- Log.Debug(Globals.LogTag, "[" + i + "] Ton: " + rec[i].Ton);
- Log.Debug(Globals.LogTag, "[" + i + "] Npi: " + rec[i].Npi);
- Log.Debug(Globals.LogTag, "[" + i + "] Number: " + rec[i].ForwardingNumber);
- }
-
- Log.Debug(Globals.LogTag, "Ss set call forward success");
- }
-
- catch(Exception ex)
- {
- Log.Debug(Globals.LogTag, "Ss set call forward exception: " + ex.ToString());
- }
-
- finally
- {
- handle.DeregisterNotiEvent(Notification.SsNotifyForwarding);
- handle.NotificationChanged -= Handle_CallForwardNotiEvent;
- }
- }
-
- private void Handle_CallForwardNotiEvent(object sender, NotificationChangedEventArgs e)
- {
- Log.Debug(Globals.LogTag, "Call forward noti event received");
- SsForwardResponse resp = (SsForwardResponse)e.Data;
- Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber);
- List<SsForwardRecord> rec = resp.Record.ToList();
- for (int i = 0; i < resp.RecordNumber; i++)
- {
- Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class);
- Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status);
- Log.Debug(Globals.LogTag, "[" + i + "] ForwardCondition: " + rec[i].ForwardCondition);
- Log.Debug(Globals.LogTag, "[" + i + "] IsFwNumPresent: " + rec[i].IsForwardingNumberPresent);
- Log.Debug(Globals.LogTag, "[" + i + "] NoReplyTime:: " + rec[i].NoReplyTime);
- Log.Debug(Globals.LogTag, "[" + i + "] Ton: " + rec[i].Ton);
- Log.Debug(Globals.LogTag, "[" + i + "] Npi: " + rec[i].Npi);
- Log.Debug(Globals.LogTag, "[" + i + "] Number: " + rec[i].ForwardingNumber);
- }
- }
-
- ~SsPage()
- {
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectTypeGuids>{2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <ProjectGuid>{BC2C461D-A67A-47FF-8AAA-D584BD379226}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Tizen.Tapitest</RootNamespace>
- <AssemblyName>Tizen.Tapitest</AssemblyName>
- <FileAlignment>512</FileAlignment>
- <DefaultLanguage>en-US</DefaultLanguage>
- </PropertyGroup>
- <PropertyGroup>
- <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
- <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
- <NuGetTargetMoniker>.NETCoreApp,Version=v1.0</NuGetTargetMoniker>
- <TargetFrameworkMoniker>.NETCoreApp,Version=v1.0</TargetFrameworkMoniker>
- <NoStdLib>true</NoStdLib>
- <NoWarn>$(NoWarn);1701</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <None Include="Tizen.Tapitest.project.json" />
- <None Include="tizen-manifest.xml" />
- <None Include="shared\res\Tizen.Tapitest.png" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="CallgsmPage.cs" />
- <Compile Include="CommonPage.cs" />
- <Compile Include="SsPage.cs" />
- <Compile Include="PhonebookPage.cs" />
- <Compile Include="SimPage.cs" />
- <Compile Include="ModemPage.cs" />
- <Compile Include="MainPage.cs" />
- <Compile Include="NetworkPage.cs" />
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Tizen.Tapi\Tizen.Tapi.csproj">
- <Project>{5bf0618d-32ca-4356-b25b-11bdfd0e6119}</Project>
- <Name>Tizen.Tapi</Name>
- </ProjectReference>
- </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.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <PropertyGroup>
- <!-- https://github.com/dotnet/corefxlab/tree/master/samples/NetCoreSample and
- https://docs.microsoft.com/en-us/dotnet/articles/core/tutorials/target-dotnetcore-with-msbuild
- -->
- <!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two
- properties to any folder that exists to skip the GetReferenceAssemblyPaths task (not target) and
- to prevent it from outputting a warning (MSB3644).
- -->
- <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
- <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
- <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
- </PropertyGroup>
- <!-- Include tasks for Tizen -->
- <PropertyGroup>
- <TizenBuildPath>$(MSBuildExtensionsPath)\Tizen</TizenBuildPath>
- <TizenToolsPath>$(TizenBuildPath)\bin</TizenToolsPath>
- </PropertyGroup>
- <UsingTask TaskName="Tizen.Tasks.SignPackage.TizenCleanPackageSource" AssemblyFile="$(TizenToolsPath)\Tizen.Tasks.SignPackage.dll" />
- <UsingTask TaskName="Tizen.Tasks.SignPackage.TizenPreparePackageManifest" AssemblyFile="$(TizenToolsPath)\Tizen.Tasks.SignPackage.dll" />
- <UsingTask TaskName="Tizen.Tasks.SignPackage.TizenPreparePackageSource" AssemblyFile="$(TizenToolsPath)\Tizen.Tasks.SignPackage.dll" />
- <UsingTask TaskName="Tizen.Tasks.SignPackage.TizenSignPackage" AssemblyFile="$(TizenToolsPath)\Tizen.Tasks.SignPackage.dll" />
- <!-- Task to clean package source -->
- <Target Name="_TizenCleanPkgSrc">
- <TizenCleanPackageSource SolutionPath="$(SolutionPath)" ProjectPath="$(MSBuildProjectFullPath)" />
- </Target>
- <!-- Task to prepare tizen-manifest.xml file -->
- <Target Name="_TizenPrepManifest">
- <TizenPreparePackageManifest SolutionPath="$(SolutionPath)" ProjectPath="$(MSBuildProjectFullPath)" />
- </Target>
- <!-- Task to prepare package sources(executable, dlls, resource files) -->
- <Target Name="_TizenPrepPkgSrc">
- <TizenPreparePackageSource SolutionPath="$(SolutionPath)" ProjectPath="$(MSBuildProjectFullPath)" AssemblyName="$(AssemblyName)" TargetPath="$(TargetPath)" />
- </Target>
- <!-- Task to signing and packaging -->
- <Target Name="_TizenSignPackge">
- <TizenSignPackage SolutionPath="$(SolutionPath)" ProjectPath="$(MSBuildProjectFullPath)" SolutionName="$(SolutionName)" AuthorCertificate="$(AuthorCertificate)" AuthorPasswd="$(AuthorPasswd)" DistribCertificate="$(DistribCertificate)" DistribPasswd="$(DistribPasswd)" />
- </Target>
- <ProjectExtensions>
- <VisualStudio>
- <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Debug|Any CPU">
- <ProjectCommonFlavorCfg />
- </FlavorProperties>
- <FlavorProperties GUID="{2F98DAC9-6F16-457B-AED7-D43CAC379341}" Configuration="Release|Any CPU">
- <ProjectCommonFlavorCfg />
- </FlavorProperties>
- </VisualStudio>
- </ProjectExtensions>
-</Project>
\ No newline at end of file
+++ /dev/null
-{
- "buildOptions": {
- "emitEntryPoint": true,
- "debugType": "portable",
- "platform": "AnyCPU",
- "preserveCompilationContext": true
- },
- "dependencies": {
- "ElmSharp": "1.2.0-beta-001",
- "Microsoft.NETCore.App": "1.1.1",
- "Tizen.Applications.UI": "1.5.8",
- "Xamarin.Forms": "2.3.5.239-pre3",
- "Xamarin.Forms.Platform.Tizen": "2.3.5-r233-008"
- },
- "runtimes": {
- "win": {},
- "linux": {}
- },
- "frameworks": {
- "netcoreapp1.0": {
- "imports": [
- "portable-net45+wp80+win81+wpa81",
- "netstandard1.6"
- ]
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest package="Tizen.Tapitest" version="1.0.0" api-version="3.0" xmlns="http://tizen.org/ns/packages">
- <profile name="common" />
- <ui-application appid="Tizen.Tapitest" exec="Tizen.Tapitest.exe" multiple="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
- <icon>Tizen.Tapitest.png</icon>
- <label>Tizen.Tapitest</label>
- </ui-application>
- <shortcut-list />
- <privileges>
- <privilege>http://tizen.org/privilege/telephony</privilege>
- <privilege>http://tizen.org/privilege/telephony.admin</privilege>
- </privileges>
-</manifest>