Skip to content

Commit

Permalink
Release 1.3.8 of TI Simplelink Connect (#29)
Browse files Browse the repository at this point in the history
This commit consolidates work done for Release 1.3.8 of the TI
Simplelink Connect iOS and Android application

Changes:
    1. Bluetooth and Scanning Improvements:
        - Disabled scanning when the phone's Bluetooth is turned off.
        - Added an alert message to notify users if phone's Bluetooth is turned off.
    2. Health Thermometer Profile Enhancements:
        - Added support for floating-point temperature values.
        - Introduced an option to export Health Thermometer data as a CSV file.
    3. ECG Holter Service Update:
        - Added indicator leds.
    4. OAD:
        - Added CC2755R10 and CC2745R10-Q10 Support.
    5. Stress Test Enhancements:
        - Ensured the Simple Peripheral Profile receives notifications when enabling them.
        - Updated JSON test results file.
        - Modified the bonding logic to remove bonds only for devices selected for testing.

Signed-off-by: Texas Instruments
  • Loading branch information
EdenCohenTI committed Dec 24, 2024
1 parent ec81075 commit 8879756
Show file tree
Hide file tree
Showing 27 changed files with 602 additions and 189 deletions.
10 changes: 0 additions & 10 deletions Release Notes 1.3.7.txt

This file was deleted.

21 changes: 21 additions & 0 deletions Release Notes 1.3.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Release 1.3.8 of TI Simplelink Connect (#29)
This commit consolidates work done for Release 1.3.8 of the TI
Simplelink Connect iOS and Android application

Changes:
1. Bluetooth and Scanning Improvements:
- Disabled scanning when the phone's Bluetooth is turned off.
- Added an alert message to notify users if phone's Bluetooth is turned off.
2. Health Thermometer Profile Enhancements:
- Added support for floating-point temperature values.
- Introduced an option to export Health Thermometer data as a CSV file.
3. ECG Holter Service Update:
- Added indicator leds.
4. OAD:
- Added CC2755R10 and CC2745R10-Q10 Support.
5. Stress Test Enhancements:
- Ensured the Simple Peripheral Profile receives notifications when enabling them.
- Updated JSON test results file.
- Modified the bonding logic to remove bonds only for devices selected for testing.

Signed-off-by: Texas Instruments
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ <h2 id="ProductName">
</h2>

<h4 id="ReleaseDate">
<span>2024-26-08</span>
<span>2024-16-12</span>
</h2>

<h4 id="SRASID">
Manifest ID - <span>SRAS00011645</span>
Manifest ID - <span>SRAS00012124</span>
</h4>

</div><div id="content">
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ android {
applicationId 'com.ti.connectivity.simplelinkconnect'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 21
versionName "1.3.7"
versionCode 22
versionName "1.3.8"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "SimpleLink™ Connect",
"slug": "SimplelinkConnect",
"version": "1.3.7",
"version": "1.3.8",
"orientation": "portrait",
"icon": "./src/assets/images/icon.png",
"scheme": "myapp",
Expand Down
20 changes: 10 additions & 10 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ PODS:
- DGCharts (= 5.0.0)
- React
- SwiftyJSON (= 5.0)
- react-native-document-picker (9.1.1):
- react-native-document-picker (9.3.1):
- React-Core
- react-native-get-random-values (1.8.0):
- React-Core
- react-native-idle-timer (2.2.1):
- react-native-idle-timer (2.2.3):
- React-Core
- react-native-loader-kit (2.0.8):
- NVActivityIndicatorView (= 5.1.1)
Expand Down Expand Up @@ -340,15 +340,15 @@ PODS:
- React-perflogger (= 0.69.9)
- RNCAsyncStorage (1.17.12):
- React-Core
- RNDeviceInfo (10.13.0):
- RNDeviceInfo (10.14.0):
- React-Core
- RNFlashList (1.1.0):
- React-Core
- RNFS (2.20.0):
- React-Core
- RNGestureHandler (2.5.0):
- React-Core
- RNKeychain (8.1.3):
- RNKeychain (8.2.0):
- React-Core
- RNReanimated (2.9.1):
- DoubleConversion
Expand Down Expand Up @@ -380,7 +380,7 @@ PODS:
- RNScreens (3.15.0):
- React-Core
- React-RCTImage
- RNSVG (12.3.0):
- RNSVG (12.5.1):
- React-Core
- SwiftyJSON (5.0.0)
- Yoga (1.14.0)
Expand Down Expand Up @@ -621,9 +621,9 @@ SPEC CHECKSUMS:
React-logger: 96d904c5bc87c2660d48e6a36fb2edf65f9cfb11
react-native-ble-manager: f8add48474ad08a0bd3e46b2d1ebff5e00a628b7
react-native-charts-wrapper: cd83d9b1acb8e06ebd18bf297de597906e1cc87d
react-native-document-picker: 3599b238843369026201d2ef466df53f77ae0452
react-native-document-picker: 940269e45632f48eb5e81543381ffd15a970d849
react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a
react-native-idle-timer: f1920a59fe776340d004ff9de13c4a6eedcc8807
react-native-idle-timer: b4e9ff189950bcd3ba03257d9f033f3432341db8
react-native-loader-kit: ed18c8ce83b69083211912326897d8286f37d797
react-native-restart: 7595693413fe3ca15893702f2c8306c62a708162
react-native-safe-area-context: 6c12e3859b6f27b25de4fee8201cfb858432d8de
Expand All @@ -640,14 +640,14 @@ SPEC CHECKSUMS:
React-runtimeexecutor: df1518d092e8c74cafddc56690d1ac386ec24d7a
ReactCommon: fac40473e2c4117522384027ab33ad0cb6717dc5
RNCAsyncStorage: 09fc8595e6d6f6d5abf16b23a56b257d9c6b7c5b
RNDeviceInfo: 5e4695f906aeb624855cee8d568a46037e4a50f7
RNDeviceInfo: 59344c19152c4b2b32283005f9737c5c64b42fba
RNFlashList: 031c182b95ead44fd0715f6029a744cd5e10d51f
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNGestureHandler: bad495418bcbd3ab47017a38d93d290ebd406f50
RNKeychain: f1b48665a4646f61191eb048c4c05c58d9a7596f
RNKeychain: bfe3d12bf4620fe488771c414530bf16e88f3678
RNReanimated: 2cf7451318bb9cc430abeec8d67693f9cf4e039c
RNScreens: 4a1af06327774490d97342c00aee0c2bafb497b7
RNSVG: 302bfc9905bd8122f08966dc2ce2d07b7b52b9f8
RNSVG: d7d7bc8229af3842c9cfc3a723c815a52cdd1105
SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7
Yoga: 7a4d48cfb35dfa542151e615fa73c1a0d88caf21

Expand Down
4 changes: 3 additions & 1 deletion ios/SimplelinkConnect.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,13 @@
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SimplelinkConnect/Pods-SimplelinkConnect-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNDeviceInfo/RNDeviceInfoPrivacyInfo.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNDeviceInfoPrivacyInfo.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -396,7 +398,7 @@
INFOPLIST_KEY_CFBundleDisplayName = "SimpleLink™ Connect";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.3.7;
MARKETING_VERSION = 1.3.8;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion ios/SimplelinkConnect/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.3.7</string>
<string>1.3.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simplelinkconnect",
"version": "1.3.7",
"version": "1.3.8",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
Expand Down
20 changes: 18 additions & 2 deletions src/components/BleDevice/DeviceInfo/DeviceState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import { View, StyleSheet, Platform, Alert, Linking, useWindowDimensions } from 'react-native';
import { View, StyleSheet, Platform, Alert, Linking, useWindowDimensions, NativeModules, NativeEventEmitter } from 'react-native';
import { Text } from '../../Themed';
import React, { useCallback, useMemo, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { TouchableOpacity } from '../../Themed';
import Colors from '../../../constants/Colors';
import { DeviceScreenNavigationProp } from '../../../../types';
Expand Down Expand Up @@ -61,9 +61,18 @@ const DeviceState: React.FC<Props> = ({
...props
}) => {
let navigation = useNavigation<DeviceScreenNavigationProp>();

const BleManagerModule = NativeModules.BleManager;
const bleManagerEmitter = new NativeEventEmitter(BleManagerModule);

const { fontScale } = useWindowDimensions();
const [isBonded, setIsBonded] = useState<boolean>(false);

useEffect(() => {
if (Platform.OS === 'android') {
bleManagerEmitter.addListener('BleManagerPeripheralDidBond', handleNewDeviceBonded);
}
}, [])

const showAlert = () =>
Alert.alert(
Expand Down Expand Up @@ -109,6 +118,13 @@ const DeviceState: React.FC<Props> = ({
}
}

const handleNewDeviceBonded = (e: any) => {
console.log('New device bonded', e)
if (e.id === peripheralId) {
setIsBonded(true);
}

}

const checkIfPeripheripheralIsBonded = async (): Promise<boolean> => {
if (Platform.OS !== 'android') return false;
Expand Down
5 changes: 3 additions & 2 deletions src/components/BleScanner/EnablerSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ import Colors from '../../../constants/Colors';
interface Props {
scanEnable: boolean;
setScanEnable: (state: boolean) => void;
disabled: boolean
}

const EnablerSection: React.FC<Props> = ({ scanEnable, setScanEnable }) => {
const EnablerSection: React.FC<Props> = ({ scanEnable, setScanEnable, disabled }) => {
const { fontScale } = useWindowDimensions();

return (
Expand All @@ -54,7 +55,7 @@ const EnablerSection: React.FC<Props> = ({ scanEnable, setScanEnable }) => {
>
Enable BluetoothLE Scan
</Text>
<Switch onValueChange={(value) => setScanEnable(value)} value={scanEnable} />
<Switch onValueChange={(value) => setScanEnable(value)} value={scanEnable} disabled={disabled} style={{ opacity: disabled ? 0.2 : 1 }} />
</View>
);
};
Expand Down
3 changes: 2 additions & 1 deletion src/components/BleScanner/ListSection/ScannedDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const ScannedDevice: React.FC<Device> = ({
</TouchableOpacity>
{!peripheral.isConnected && (
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Icon name="signal" type="font-awesome" onPress={requestConnect} color={peripheral.filter ? Colors.gray : peripheral.advertismentInActive ? Colors.gray : 'black'} />
<Icon name="signal" type="font-awesome" color={peripheral.filter ? Colors.gray : peripheral.advertismentInActive ? Colors.gray : 'black'} />
<Text style={{ width: 35, textAlign: 'center', color: peripheral.filter ? Colors.gray : peripheral.advertismentInActive ? Colors.gray : 'black', fontSize: 14 / fontScale }}> {peripheral.rssi} </Text>
<TouchableOpacity
onPress={peripheral.advertismentInActive ? () => { } : peripheral.filter ? () => { } : requestConnect}
Expand Down Expand Up @@ -215,6 +215,7 @@ const ScannedDevice: React.FC<Device> = ({
/>
</View>
)}

<ScannedDeviceInfo peripheral={peripheral} isVisible={visibleInfo} />
</View>
</View >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const ScannedDeviceInfo: React.FC<Props> = ({ isVisible, peripheral }) => {
}

return (
<View style={{ backgroundColor: 'blue' }}>
<View >
<View style={[styles.container, {
display: isVisible ? 'flex' : 'none',
backgroundColor: 'white'
Expand Down
20 changes: 19 additions & 1 deletion src/components/BleScanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
ScrollView,
RefreshControl,
useWindowDimensions,
Alert
} from 'react-native';
import React, { useState, useEffect, useMemo, useContext, useRef, useCallback } from 'react';
import BleManager, { Peripheral } from 'react-native-ble-manager';
Expand Down Expand Up @@ -71,6 +72,7 @@ const BleScanner: React.FC<Props> = () => {
const [peripherals, setPeripherals] = useState<Peripheral[]>([]);
const [doSort, setDoSort] = useState<Boolean>(false);
const [refreshing, setRefreshing] = useState(false);
const [bleState, setBleState] = useState<'on' | 'off'>('on');
const [sortOption, setSortOption] = useState<'app_name' | 'rssi' | null>(null);

let initialFocus = useRef<boolean>(true);
Expand All @@ -95,6 +97,8 @@ const BleScanner: React.FC<Props> = () => {
const task = InteractionManager.runAfterInteractions(() => {
if (initialFocus.current) {
console.log('focused');
bleManagerEmitter.addListener('BleManagerDidUpdateState', handleUpdateState);
BleManager.checkState()
initialFocus.current = false;
} else {
setScanEnable(true);
Expand All @@ -103,6 +107,7 @@ const BleScanner: React.FC<Props> = () => {
requestAndroidPermissions().then(() => {
handleConnectedAndBondedPeripherals();
});

return () => {
console.log('unfocused');
setScanEnable(false);
Expand Down Expand Up @@ -194,6 +199,19 @@ const BleScanner: React.FC<Props> = () => {
scan(scanEnable);
}, [scanEnable]);

const handleUpdateState = (stateInfo: any) => {
if (stateInfo['state'] !== 'on' && stateInfo['state'] !== 'turning_on') {
Alert.alert(
'"SimpleLink Connect" would like to use Bluetooth',
'Please enable Bluetooth using phone Settings.',);
setScanEnable(false);
setBleState('off')
}
else {
setBleState('on')
}
}

const updatePeripheralView = () => {
setPeripherals((prev) => [...prev]);

Expand Down Expand Up @@ -601,7 +619,7 @@ const BleScanner: React.FC<Props> = () => {

return (
<View style={[{ flex: 1 }]}>
<EnablerSection scanEnable={scanEnable} setScanEnable={scanSwitchEnabler} />
<EnablerSection scanEnable={scanEnable} setScanEnable={scanSwitchEnabler} disabled={bleState == 'off'} />
{/* Connected Devices */}
{memoConnectedDevices.length > 0 && (
<View style={{ maxHeight: '40%' }}>
Expand Down
Loading

0 comments on commit 8879756

Please sign in to comment.